Bitwise
land
RESCRIPT
let land: (int, int) => int
land(n1, n2)
calculates the bitwise logical AND of two integers.
Examples
RESCRIPTInt.Bitwise.land(7, 4) == 4
lor
RESCRIPT
let lor: (int, int) => int
lor(n1, n2)
calculates the bitwise logical OR of two integers.
Examples
RESCRIPTInt.Bitwise.lor(7, 4) == 7
lxor
RESCRIPT
let lxor: (int, int) => int
lxor(n1, n2)
calculates the bitwise logical XOR of two integers.
Examples
RESCRIPTInt.Bitwise.lxor(7, 4) == 3
lnot
RESCRIPT
let lnot: int => int
lnot(n)
calculates the bitwise logical NOT of an integer.
Examples
RESCRIPTInt.Bitwise.lnot(2) == -3
lsl
RESCRIPT
let lsl: (int, int) => int
lsl(n, length)
calculates the bitwise logical left shift of an integer n
by length
.
Examples
RESCRIPTInt.Bitwise.lsl(4, 1) == 8
lsr
RESCRIPT
let lsr: (int, int) => int
lsr(n, length)
calculates the bitwise logical right shift of an integer n
by length
.
Examples
RESCRIPTInt.Bitwise.lsr(8, 1) == 4
asr
RESCRIPT
let asr: (int, int) => int