0x1::BitOperators
Functions for bit operations.
and
or
xor
not
lshift
rshift
and
bit and: x & y
public fun and(x: u64, y: u64): u64
public fun and(x: u64, y: u64): u64 {
(x & y as u64)
}
or
bit or: x | y |
public fun or(x: u64, y: u64): u64
public fun or(x: u64, y: u64): u64 {
(x | y as u64)
}
xor
bit xor: x ^ y
public fun xor(x: u64, y: u64): u64
public fun xor(x: u64, y: u64): u64 {
(x ^ y as u64)
}
not
bit not: !x
public fun not(x: u64): u64
public fun not(x: u64): u64 {
(x ^ 18446744073709551615u64 as u64)
}
lshift
left shift n bits.
public fun lshift(x: u64, n: u8): u64
public fun lshift(x: u64, n: u8): u64 {
(x << n as u64)
}
rshift
right shift n bits.
public fun rshift(x: u64, n: u8): u64
public fun rshift(x: u64, n: u8): u64 {
(x >> n as u64)
}
pragma verify = false;