bitwise operator example

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

>>> def b(n): print('{:08b}'.format(n))

>>> b(5)
00000101
>>> x, y = 0x55, 0xaa
>>> b(x)
01010101
>>> b(y)
10101010
>>> b(x|y)
11111111
>>> b(x&y)
00000000
>>> b(x^y)
11111111
>>> b(x^0)
01010101
>>> b(x<<4)
10101010000
>>> b(x>>4)
00000101
>>> b(~x)
-1010110