rounded-hw-0.2.0: Directed rounding for built-in floating types
Safe HaskellNone
LanguageHaskell2010

Numeric.Rounded.Hardware.Rounding

Synopsis

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

Instances details
Bounded RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

Enum RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

Eq RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

Ord RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

Read RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

Show RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

Generic RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

Associated Types

type Rep RoundingMode :: Type -> Type #

NFData RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

Methods

rnf :: RoundingMode -> () #

type Rep RoundingMode Source # 
Instance details

Defined in Numeric.Rounded.Hardware.Internal.Rounding

type Rep RoundingMode = D1 ('MetaData "RoundingMode" "Numeric.Rounded.Hardware.Internal.Rounding" "rounded-hw-0.2.0-G2mMTdTBXOG87Ub6xfZ4rG" 'False) ((C1 ('MetaCons "ToNearest" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TowardNegInf" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TowardInf" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TowardZero" 'PrefixI 'False) (U1 :: Type -> Type)))

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

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.