bitop: Bitwise operations
This module provides basic bitwise operations. All operations expect integer arguments, and all operations are performed assuming signed 2's complement binary representations of integers. In the 2's complement representation negative integers have an infinite number of leading 1 bits, i.e. -1 is "...11111111" in binary, -2 is "...1111110", and so on.
See also: std::Int, string::IntToStr
Functions
- And(x, y)
- Return the bitwise and of two integers.
- Or(x, y)
- Return the bitwise or of two integers.
- Xor(x, y)
- Return the bitwise xor of two integers.
- Neg(x)
- Return the bitwise complement of an integer.
- Shl(x, y)
- Return the integer x shifted left bitwise y positions.
- Shr(x, y)
- Return the integer x shifted right bitwise y positions.