题解 | #数值的整数次方#
数值的整数次方
http://www.nowcoder.com/practice/1a834e5e3e1a4b7ba251417554e07c00
import java.lang.*; public class Solution { public double Power(double base, int exponent) { if(base==0) return 0.00000; if(exponent==0) return 1.00000; if(exponent==1) return base*exponent; if(exponent>0) return Power(base,exponent-1)*base; else return Power(base,exponent+1)/base; } }