Kotlinlearncs.online LogoJava
Return to List

Solve: Int Power

Created By: Chris Taylor
/ Version: 2023.6.0

Complete the following method that returns x raised to the n power. The method must throw an IllegalArgumentException if n is negative. Your implementation must use recursion and may not use the Math class or any loops.

double intPower(double x, int n) {
return 0.0; // You may need to remove this starter code
}

Related Lessons

Stuck? You may find these lessons helpful: