Pow(x, n)

Medium
Math Math Recursion

Implement pow(x, n). Handle negative exponents.

Constraints

x is float, -2^31 ≤ n ≤ 2^31-1

Examples

Example 1:
Input: 2.00000 10
Output: 1024.00000
Example 2:
Input: 2.10000 3
Output: 9.26100
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.