Pow(x, n)
Implement pow(x, n), which calculates x raised to the power n, that is x^n.
Example 1
Input
x = 2, n = 10Output
10242 raised to the 10th power equals 1024.
Example 2
Input
x = 2, n = -2Output
0.252 raised to the -2nd power equals 1 divided by 2 squared, which is 0.25.
Constraints
- -100.0 < x < 100.0
- -2^31 <= n <= 2^31 - 1
- n is an integer
- Either x != 0 or n > 0
- -10^4 <= x^n <= 10^4