判断一个数是不是2的幂次方

int judge(int a){

return ((a&(a-1))==0);

}

比如100000&(011111)==0.

原文地址:https://www.cnblogs.com/gaoqichao/p/2736627.html