power2(ll a, ll b){
ll res = 1;
a %= c;
while (b){
if (b & 1) ///判断最后一位
res = res * a;
a = a * a; ///a自乘
b >>= 1; ///b应当右移一位
}
return res;
}
小数快速幂
class Solution {
public double myPow(double x, int n) {
long N=n;
if(N<0){
x=1/x;
N=-N;
}
double ans = 1;
while(N!=0){
if(N%2==1)ans*=x;
x=x*x;
N>>=1;
}
return ans;
}
}