Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

double myPow(double x, int n) { int sign = 1; if(x<0) { sign = 0; x= -x; } double res = exp(n*log(x)); if(n%2 == 0) return res; return sign?res:-res; }

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.