| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Numeric.Rounded.Hardware.Rounding
Synopsis
- data RoundingMode
- oppositeRoundingMode :: RoundingMode -> RoundingMode
- class Rounding (r :: RoundingMode)
- rounding :: Rounding r => proxy r -> RoundingMode
- reifyRounding :: RoundingMode -> (forall s. Rounding s => Proxy s -> a) -> a
Documentation
data RoundingMode Source #
The type for IEEE754 rounding-direction attributes.
Constructors
| ToNearest | Round to the nearest value (IEEE754 roundTiesToEven) |
| TowardNegInf | Round downward (IEEE754 roundTowardNegative) |
| TowardInf | Round upward (IEEE754 roundTowardPositive) |
| TowardZero | Round toward zero (IEEE754 roundTowardZero) |
Instances
oppositeRoundingMode :: RoundingMode -> RoundingMode Source #
Returns the opposite rounding direction.
TowardNegInf and TowardInf are swapped.
class Rounding (r :: RoundingMode) Source #
This class allows you to recover the runtime value from a type-level rounding mode.
See rounding.
Minimal complete definition
roundingT
Instances
| Rounding 'ToNearest Source # | |
Defined in Numeric.Rounded.Hardware.Internal.Rounding Methods | |
| Rounding 'TowardNegInf Source # | |
Defined in Numeric.Rounded.Hardware.Internal.Rounding Methods | |
| Rounding 'TowardInf Source # | |
Defined in Numeric.Rounded.Hardware.Internal.Rounding Methods | |
| Rounding 'TowardZero Source # | |
Defined in Numeric.Rounded.Hardware.Internal.Rounding Methods | |
rounding :: Rounding r => proxy r -> RoundingMode Source #
Recovers the value from type-level rounding mode.
reifyRounding :: RoundingMode -> (forall s. Rounding s => Proxy s -> a) -> a Source #
Lifts a rounding mode to type-level.