Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data RoundingMode
- bfStatus :: HasCallStack => (a, Status) -> a
- fppOpts :: FloatPrecisionRepr fpp -> RoundingMode -> BFOpts
- toRoundMode :: RoundingMode -> RoundMode
- fpOpts :: Integer -> Integer -> RoundMode -> BFOpts
- floatFromInteger :: BFOpts -> Integer -> BigFloat
- floatFromRational :: BFOpts -> Rational -> BigFloat
- floatToRational :: BigFloat -> Maybe Rational
- floatToInteger :: RoundingMode -> BigFloat -> Maybe Integer
- floatRoundToInt :: HasCallStack => FloatPrecisionRepr fpp -> RoundingMode -> BigFloat -> BigFloat
Documentation
data RoundingMode Source #
Rounding modes for IEEE-754 floating point operations.
RNE | Round to nearest even. |
RNA | Round to nearest away. |
RTP | Round toward plus Infinity. |
RTN | Round toward minus Infinity. |
RTZ | Round toward zero. |
Instances
bfStatus :: HasCallStack => (a, Status) -> a Source #
fppOpts :: FloatPrecisionRepr fpp -> RoundingMode -> BFOpts Source #
toRoundMode :: RoundingMode -> RoundMode Source #
fpOpts :: Integer -> Integer -> RoundMode -> BFOpts Source #
Make LibBF options for the given precision and rounding mode.
floatFromInteger :: BFOpts -> Integer -> BigFloat Source #
Make a floating point number from an integer, using the given rounding mode
floatFromRational :: BFOpts -> Rational -> BigFloat Source #
Make a floating point number from a rational, using the given rounding mode
floatToRational :: BigFloat -> Maybe Rational Source #
Convert a floating point number to a rational, if possible.
floatToInteger :: RoundingMode -> BigFloat -> Maybe Integer Source #
Convert a floating point number to an integer, if possible.
floatRoundToInt :: HasCallStack => FloatPrecisionRepr fpp -> RoundingMode -> BigFloat -> BigFloat Source #