type Int = Int
A primitive type representing an arbitrary-precision integer.
Integer operations.
type Int = Int
A primitive type representing an arbitrary-precision integer.
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] Option<Int>
Parses a decimal string into an integer.
Returns .none! 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)