double myPow(double x, int n) {

```
if(n==0)
return 1.0;
if(n<0)
{
y = 1/x;
n = -n;
}
double temp = myPow(y,n/2);
return (n%2==1?temp*temp*y:temp*temp);
```

}

// when n is = -2147483648 then -n is also the same.How to deal with this case?