type Int = Int
Module Int
Integer operations.
Returns the absolute value of an integer as a natural number.
Int.Clamp(x)(lo, hi) clamps x to the inclusive range [lo, hi].
Int.Clamp(7)(0, 5) // = 5
Int.Clamp(-3)(0, 5) // = 0
dec Int.FromString : [String] either { .err !, .ok Int, }
Parses a decimal string into an integer.
Returns .err! when the string is not a valid integer.
Returns the larger of two integers.
Returns the smaller of two integers.
Int.Mod(x, n) returns the non-negative remainder of x modulo n.
The result is in [0, n), or 0 when n is 0.
Int.Range(lo, hi) produces the integers from lo (inclusive) to hi (exclusive).
Int.Range(0, 5) // = *(0, 1, 2, 3, 4)