div package:ghc-internal
Integer division truncated toward negative infinity.
WARNING: This function is partial (because it throws when 0 is passed
as the divisor) for all the integer types in base.
Division (round down) of natural numbers. Div x 0 is
undefined (i.e., it cannot be reduced).
Used to implement
div for the
Integral typeclass. This
performs integer division on its two parameters, truncated towards
negative infinity.
Example
>>> 10 `divInt` 2
5
>>> 10 `div` 2
5
Used to implement
divMod for the
Integral typeclass.
This gives a tuple equivalent to
(div x y, mod x y)
Example
>>> divModInt 10 2
(5,0)
>>> divMod 10 2
(5,0)
Divide two vectors element-wise.
Divide two vectors element-wise.
Divide two vectors element-wise.
Divide two vectors element-wise.
Divide two vectors element-wise.
Divide two vectors element-wise.
Used to implement
div for the
Integral typeclass.
This performs integer division on its two parameters, truncated
towards negative infinity.
Example
>>> 10 `divInteger` 2
5
>>> 10 `div` 2
Used to implement
divMod for the
Integral typeclass.
This gives a tuple equivalent to
(div x y, mod x y)
Example
>>> divModInteger 10 2
(5,0)
>>> divMod 10 2
(5,0)
simultaneous
div and
mod.
WARNING: This function is partial (because it throws when 0 is passed
as the divisor) for all the integer types in
base.