负数用补码表示 17=00010001 30=00011110-17 =11101111 -30=111000100 0 0 0 1 1 0 1 (13)1 1 1 0 1 1 1 1 (-17)-------------------------------------or 1 1 1 0 1 1 1 1 (-17)xor 1 1 1 0 0 0 1 0 (-30)
为什么13 or -17=-17?为什么13 xor -17=-30?
负数用补码表示 17=00010001 30=00011110-17 =11101111 -30=111000100 0 0 0 1 1 0 1 (13)1 1 1 0 1 1 1 1 (-17)-------------------------------------or 1 1 1 0 1 1 1 1 (-17)xor 1 1 1 0 0 0 1 0 (-30)