@[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 = 4
1 <<< 3 = 8
0 <<< 3 = 0
0xf1 <<< 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 = 1
8 >>> 2 = 2
8 >>> 3 = 1
0 >>> 3 = 0
0xf13a >>> 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
.