Version: 0.25.0

Bitwise

let and: (a: 'a, b: nat) => nat

'a can either be an int or nat.

A bitwise and operation.

let zero: nat = Bitwise.and(2 as nat, 1 as nat);
let or: (a: nat, b: nat) => nat

A bitwise or operation.

let three: nat = Bitwise.or(2 as nat, 1 as nat);
let xor: (a: nat, b: nat) => nat

A bitwise xor operation.

let three: nat = Bitwise.xor(2 as nat, 1 as nat);
let shift_left: (a: nat, b: nat) => nat

A bitwise shift left operation.

let four: nat = Bitwise.shift_left(2 as nat, 1 as nat);
let shift_right: (a: nat, b: nat) => nat

A bitwise shift right operation.

let one: nat = Bitwise.shift_right(2 as nat, 1 as nat);