gleam/bitwise

A set of functions for bitwise operations on integers.

Functions

pub fn and(x: Int, y: Int) -> Int

Calculates the bitwise AND of its arguments.

pub fn exclusive_or(x: Int, y: Int) -> Int

Calculates the bitwise XOR of its arguments.

pub fn not(x: Int) -> Int

Calculates the bitwise NOT of its argument.

pub fn or(x: Int, y: Int) -> Int

Calculates the bitwise OR of its arguments.

pub fn shift_left(x: Int, y: Int) -> Int

Calculates the result of an arithmetic left bitshift.

pub fn shift_right(x: Int, y: Int) -> Int

Calculates the result of an arithmetic right bitshift.