Fraction Exponents

This is a discussion on Fraction Exponents within the C++ Programming forums, part of the General Programming Boards category; Hey I need to know how to calculate fraction exponents such as: answer = x to the power of y/z ...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    11

    Fraction Exponents

    Hey I need to know how to calculate fraction exponents such as:
    answer = x to the power of y/z
    ex: answer = 5 to the power of two fifths
    Thanks for any help your can give.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,691

  3. #3
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    pow(x,y/z)
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  4. #4
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Rational exponents are defined as:
    x^(a/b) = The b:th root of x^a
    On rare occations this can be calculated exactly, but usually we can only approximate it.
    x raised to the power of an irrational number is approximated using rational numbers.

    x^a is undefined if x is negative and a is an irrational number.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  5. #5
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    FYI - The pow() function is in <cmath>.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with fraction division function
    By trippedwire in forum C++ Programming
    Replies: 6
    Last Post: 10-24-2004, 12:38 PM
  2. A tragedy!
    By Aakash Datt in forum C++ Programming
    Replies: 4
    Last Post: 05-01-2003, 07:57 PM
  3. Overloading insertion and extraction problem
    By Curwa in forum C++ Programming
    Replies: 1
    Last Post: 01-15-2003, 09:20 PM
  4. Help with Fraction class
    By cheeisme123 in forum C++ Programming
    Replies: 0
    Last Post: 06-04-2002, 08:48 AM
  5. reducing a fraction
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 03-13-2002, 08:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21