obiloud / numeric-decimal / Numeric.Integer

Bounds

maxBound : Basics.Int

Max safe integer.

minBound : Basics.Int

Min safe integer.

Integral

truncate : Basics.Float -> Basics.Int

truncate x returns the integer nearest x between zero and x

quot : Basics.Int -> Basics.Int -> Basics.Int

Integer division truncated towards zero.

rem : Basics.Int -> Basics.Int -> Basics.Int

integer remainder, satisfying

quot x y * y + rem x y == x

div : Basics.Int -> Basics.Int -> Basics.Int

Integer division truncated towards negative infinity.

mod : Basics.Int -> Basics.Int -> Basics.Int

integer modulus, satisfying

div x y * y + mod x y == x

quotRem : Basics.Int -> Basics.Int -> ( Basics.Int, Basics.Int )

simultaneous quot and rem

divMod : Basics.Int -> Basics.Int -> ( Basics.Int, Basics.Int )

simultaneous div and mod

Numeric functions

signum : Basics.Int -> Basics.Int

Sign of x number. The functions abs and signum should satisfy the law:

abs x * signum x == x

For real numbers, the signum is either -1 (negative), 0 (zero) or 1 (positive).

even : Basics.Int -> Basics.Bool

even predicate

odd : Basics.Int -> Basics.Bool

odd predicate

gcd : Basics.Int -> Basics.Int -> Basics.Int

gcd x y is the non-negative factor of both x and y of which every common factor of x and y is also x factor; for example gcd 4 2 = 2, gcd (-4) 6 = 2, gcd 0 4 = 4. gcd 0 0 = 0. (That is, the common divisor that is "greatest" in the divisibility preordering.)

Note: Since for signed fixed-width integer types, abs minBound < 0, the result may be negative if one of the arguments is minBound (and necessarily is if the other is 0 or minBound) for such types.

lcm : Basics.Int -> Basics.Int -> Basics.Int

lcm x y is the smallest positive integer that both x and y divide.