- You may assume that -9 ≤ x, n ≤ +9.
- You may assume that x ≠ 0, for the sake of avoiding 0 ' 0, 0 ' -1, etc.
- You may assume that 1e-4 ≤ |x ' n| ≤ 1e9.
- The output must be precise to 3 significant digits for the given test cases.
- Input/output may be taken/given in any standard format.
x, n -> output
1, 0 -> 1
3.14159, 0 -> 1
9, 0 -> 1
-1, 0 -> -1
-9, 0 -> -1
1, 1 -> 1
9, 1 -> 9
-15, 1 -> -15
-1.23456, 1 -> -1.23456
-9, 1 -> -9
4, 2 -> 16
3, 2 -> 9
2, 2 -> 4
1, 2 -> 1
-1, 2 -> -1
-24, 2 -> -416
-35, 2 -> -925
1.4142, 2 -> 1.99996
-4, 3 -> -64
-6, 56 -> -777646556
-9, 9 -> -387420489
9, 9 -> 387420489
0.1, 4 -> 0.0001
1, -1 -> 1
2, -1 -> 0.5
3, -1 -> 0.33333
-3, -1 -> -0.33333
5, -2 -> 0.04
2, -5 -> 0.03125
2.71828, -9 -> 0.0001234
1, 0.5 -> 1
2, 0.5 -> 1.41421
4, 0.5 -> 2
-2, 0.5 -> -1.41421
-4, 0.5 -> -2
2, -0.5 -> 0.7071
3.8236, -1.6702 -> 0.10645
0.1, -9 -> 1000000000