Prev: Numeric Types
Up: Numeric Types
Top: Top
2.1.4.1. Bit-string Operations on Integer Types.
Plain and long integer types support additional operations that make
sense only for bit-strings. Negative numbers are treated as their 2's
complement value:
- Operation
- Result --- Notes
~x
- the bits of x inverted
x ^ y
- bitwise exclusive or of x and y
x & y
- bitwise and of x and y
x | y
- bitwise or of x and y
x << n
- x shifted left by n bits
x >> n
- x shifted right by n bits