Redefine the method power (Display 11.3) so that it also works for negative
exponents. To do this, you also have to change the type of the value returned to
double. The method heading for the redefined version of power is as follows:
/**
Precondition: If n <>
Returns x to the power n.
*/
public static double power(int x, int 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