Bit Manipulantion 技巧

来源:互联网 发布:创维酷开软件下载 编辑:程序博客网 时间:2024/05/16 07:30

power of two
条件:!num & (num - 1)可以用来判断一个数是否为2的次方数
power of four
条件:(power of 2)&&(4的次方数,减1之后可以被3整除)

0 0