The same method works for C++ but not Java because of this corner case:-2147483648. Could any smart people help with it??? Really appreciate it!

```
public class Solution {
public double myPow(double x, int n) { // Time Limit Exceeded
if ( n < 0 ) {
return 1.0/power ( x, -n);
}
return power( x, n );
}
public double power ( double x, int n ) {
if ( n == 0 ) {return 1;}
double v = power ( x, n/2 );
return (n%2==1? (v * v * x) : (v * v));
}
}
```

Here is the only case I didn't pass:

```
Input:
2.00000
-2147483648
Output:
1.00000
Expected:
0.00000
```