Redefine the function power so that it also works for negative exponents.
In order to do this, you will also have to change the type of the value
returned to double. The function declaration and header comment for the
redefined version of power is as follows:
double power(int x, int n);
//Precondition: If n <>
//Returns x to the power n.
(Hint: x–n is equal to 1/(xn).)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here