46. Pow(x, n)
MediumMath
Implement pow(x, n), which calculates x raised to the power n (i.e., x^n).
Examples
Input: 2.00000 10
Output: 1024.0
Explanation: 2^10 = 1024.
Constraints
- -100.0 < x < 100.0
- -2^31 <= n <= 2^31 - 1
- n is an integer.
- Either x is not zero or n > 0.
- -10^4 <= x^n <= 10^4
Loading...
Run checks all cases above. Submit evaluates all test cases.