glat/util

Functions

pub fn gcd(a: Int, b: Int) -> Int
pub fn int_power(base: Int, of exponent: Int) -> Int

Returns 0 if the exponent is negative

pub fn int_power_check(
  base: Int,
  of exponent: Int,
) -> Result(Int, Nil)

Returns Error if the exponent is negative.

Search Document