摘要:
double powerWithUnsignedExponent(double base,unsigned int exponent){ if(exponent==0) return 1; if(exponent==1) return base; double result=powerWithUnsignedExponent(base,exponent>>1);//exponent>>1即exponent/2 result*=result; if(exponent & 0x1==1)//a & 0x1相当于a%2 result*=base; return 阅读全文