带符号的按位运算Signed Bitwise Operations

ANSI 3.3:对带符号整数进行的按位运算的结果ANSI 3.3 The results of bitwise operations on signed integers

对带符号整数进行的按位运算的工作方式与对无符号整数进行的按位运算的工作方式相同。Bitwise operations on signed integers work the same as bitwise operations on unsigned integers. 例如,-16 & 99 可用二进制格式表示For example, -16 & 99 can be expressed in binary as

  11111111 11110000  
& 00000000 01100011  
  _________________  
  00000000 01100000  

按位“与”的结果为 96。The result of the bitwise AND is 96.

另请参阅See Also

整数Integers