gleam/bitwise

A set of functions for bitwise operations on integers.

Functions

and

pub external fn and(Int, Int) -> Int

Calculates the bitwise AND of its arguments.

exclusive_or

pub external fn exclusive_or(Int, Int) -> Int

Calculates the bitwise XOR of its arguments.

not

pub external fn not(Int) -> Int

Calculates the bitwise NOT of its argument.

or

pub external fn or(Int, Int) -> Int

Calculates the bitwise OR of its arguments.

shift_left

pub external fn shift_left(Int, Int) -> Int

Calculates the result of an arithmetic left bitshift.

shift_right

pub external fn shift_right(Int, Int) -> Int

Calculates the result of an arithmetic right bitshift.