有符号右移(算数右移)保留符号位
int a = 16;
a: 00000000 00000000 00000000 00010000
a >> 2: 0000000000 00000000 00000000 000100
int b = -16;
b: 11111111 11111111 11111111 11110000
b >> 2: 1111111111 11111111 11111111 111100
无符号右移(逻辑右移)不保留符号位
unsigned int a = 16;
a: 00000000 00000000 00000000 00010000
a >> 2: 0000000000 00000000 00000000 000100
unsigned int a = -16;
a: 11111111 11111111 11111111 11110000
a >>2 0011111111 11111111 11111111 111100
int a = 100010101
int b = 011011011
int c = 001101011
int d = 101010101
异或为无进位二进制加法
a^b = c
x^x = 0
x = 100010101
x = 100010101
x^0 = x
x = 100010101
0 = 000000000
a^b = c
a^b^a = c^a
a^a^b = c^a
0^b = c^a
b = c^a
标签:11111111,右移,运算,100010101,00000000,16,int
From: https://www.cnblogs.com/cly312/p/18416165