class Solution {

public:

double myPow(double x, int n) {

double pow_x = 1.00000;

if (n == 0)

return 1.0;

double half = pow(x, n/2);

if (n%2 == 0)

{

return half*half;
}
else if (n>0)
{
return half*half

*x;*

}

else

{

return half/xhalf;

}

else

{

return half/x

}

```
//return pow_x;
}
```

};