| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ivory.Language.IIntegral
Synopsis
- class (IvoryExpr a, IvoryOrd a, Num a) => IvoryIntegral a where
- (./) :: IvoryIntegral a => a -> a -> a
- iRem :: IvoryIntegral a => a -> a -> a
Documentation
class (IvoryExpr a, IvoryOrd a, Num a) => IvoryIntegral a where Source #
Integral, without the baggage from Haskell (i.e., supertypes of Real and
Enum). Defines Euclidian division (rather than truncated division). See
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.74.8522. Notable
properties, beyond the normal div/rem properties, are that
The remainder is always non-negative.
For d1 < 0, d0 .
For d1 < 0, iDiv (-d1) == -(d0 iDiv d1)d0 .% (-d1) == d0 .% d1.
N.B. mod and rem are equal if both args are positive, and C has no mod
operator (only rem). In Haskell and C, both mod and rem may return
negative values. Furthermore, before C99, the result of rem is
implementation-defined.
Minimal complete definition
Nothing
Methods
Euclidean division.
Euclidean remainder.
(./) :: IvoryIntegral a => a -> a -> a Source #
iRem :: IvoryIntegral a => a -> a -> a Source #