@[extern lean_nat_shiftl]
Shifts the binary representation of a value left by the specified number of bits. Usually accessed
via the <<< operator.
Examples:
1 <<< 2 = 41 <<< 3 = 80 <<< 3 = 00xf1 <<< 4 = 0xf10
Equations
Instances For
@[extern lean_nat_shiftr]
Shifts the binary representation of a value right by the specified number of bits. Usually accessed
via the >>> operator.
Examples:
4 >>> 2 = 18 >>> 2 = 28 >>> 3 = 10 >>> 3 = 00xf13a >>> 8 = 0xf1
Equations
Instances For
testBit #
We define an operation for testing individual bits in the binary representation of a number.
Returns true if the (n+1)th least significant bit is 1, or false if it is 0.