Perform bitwise AND, OR, XOR, NOT and shifts in your browser — handy for low-level work.
&、OR |、XOR ^、NOT ~、左移 <<、右移 >>、无符号右移 >>>。~x = −x − 1;>> 保留符号位,>>> 高位补 0。(v & mask) >> shift、置位 v | (1 << k)、清位 v & ~(1 << k)。| Item | Formula / Note | Source / Standard |
|---|---|---|
| Basic operators | AND &, OR |, XOR ^ and NOT ~ | ISO/IEC 9899 (C) |
| Shifts | left shift multiplies by 2^n; right shift may be arithmetic | ISO/IEC 9899 (C) |
| Negative numbers | two's complement: -x = ~x + 1 | ISO/IEC 9899 (C) |