if ((n & -n) == n)

来源:学生作业学帮网 编辑:学帮网 时间:2024/05/15 02:22:29

if ((n & -n) == n)

数字和补码的与运算
1
10
100
能够等于自身
满足2的N次方