public static double power2(double x, int n) { if (n <= 0.0) return 1.0; else return x * power2(x, n-1); }