Safe Haskell | None |
---|---|
Language | Haskell98 |
Generally before using quot
and rem
, think twice.
In most cases divMod
and friends are the right choice,
because they fulfill more of the wanted properties.
On some systems quot
and rem
are more efficient
and if you only use positive numbers, you may be happy with them.
But we cannot warrant the efficiency advantage.
See also: Daan Leijen: Division and Modulus for Computer Scientists http://www.cs.uu.nl/%7Edaan/download/papers/divmodnote-letter.pdf, http://www.haskell.org/pipermail/haskell-cafe/2007-August/030394.html
Documentation
class (C a, C a, Ord a, C a) => C a where Source #
Remember that divMod
does not specify exactly what a
should be,
mainly because there is no sensible way to define it in general.
For an instance of quot
bAlgebra.RealIntegral.C a
,
it is expected that a
will round towards 0 and
quot
ba
will round towards minus infinity.div
b
Minimal definition: nothing required
Nothing
Instances
C Int Source # | |
C Int8 Source # | |
C Int16 Source # | |
C Int32 Source # | |
C Int64 Source # | |
C Integer Source # | |
C Word Source # | |
C Word8 Source # | |
C Word16 Source # | |
C Word32 Source # | |
C Word64 Source # | |
C T Source # | |
C a => C (T a) Source # | |
Integral a => C (T a) Source # | |
(C a, C a) => C (T a) Source # | |
C a => C (T a) Source # | |