Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Saturating a
- toSaturating :: SaturatingNum a => a -> Saturating a
Documentation
data Saturating a Source #
A saturating number type is one where all operations saturate at the
bounds of the underlying type, i.e. operations which overflow return
maxBound
and operations that underflow return minBound
.
Numbers can be converted to saturate by default using toSaturating
.
Instances
toSaturating :: SaturatingNum a => a -> Saturating a Source #