@@ -0,0 +1,693 @@
+package leetcode.powx_n;%0A%0Apublic class Solution %7B%0A    public double pow(double x, long n) %7B%0A    %09if(x == 0)%7B%0A    %09%09if(n == 0) return Double.NaN;%0A    %09%09else return 0;%0A    %09%7Delse%7B%0A    %09%09if(n %3C 0)%7B%0A    %09%09%09return 1 / pow(x, -n);%0A    %09%09%7Delse if(n %3E 0)%7B%0A    %09%09%09if(n %25 2 == 0)%7B%0A    %09%09%09%09double tmp = pow(x, n / 2);%0A    %09%09%09%09return tmp * tmp;%0A    %09%09%09%7Delse%7B%0A    %09%09%09%09double tmp = pow(x, n - 1);%0A    %09%09%09%09return tmp * x;%0A    %09%09%09%7D%0A    %09%09%7Delse%7B%0A    %09%09%09return 1;%0A    %09%09%7D%0A    %09%7D%0A    %7D%0A    public double pow(double x, int n)%7B%0A    %09return pow(x, (long)n);%0A    %7D%0A%0A    public static void main(String%5B%5D args)%7B%0A    %09double x = 1.;%0A    %09long n = -2147483648;%0A    %09System.err.println(new Solution().pow(x, n));%0A    %7D%0A%7D%0A

Add java solution for 50. Pow(x, n)