obiloud/numeric-decimal/2.0.1

NOTE: the latest version is 3.0.1

Numeric.Integer

Bounds

maxBound : Int

Max safe integer.

minBound : Int

Min safe integer.

Integral

quot : Int -> Int -> Int

Integer division truncated towards zero.

rem : Int -> Int -> Int

integer remainder, satisfying

quot x y * y + rem x y == x
div : Int -> Int -> Int

Integer division truncated towards negative infinity.

mod : Int -> Int -> Int

integer modulus, satisfying

div x y * y + mod x y == x
quotRem : Int -> Int -> ( Int, Int )

simultaneous quot and rem

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

simultaneous div and mod

Numeric functions

signum : Int -> 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 : Int -> Bool

even predicate

odd : Int -> Bool

odd predicate

gcd : Int -> Int -> 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 : Int -> Int -> Int

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