base-compat-0.10.5: A compatibility layer for base

Safe HaskellSafe
LanguageHaskell98

Numeric.Compat

Synopsis

Documentation

module Numeric

showFFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS #

Show a signed RealFloat value using standard decimal notation (e.g. 245000, 0.0015).

This behaves as showFFloat, except that a decimal point is always guaranteed, even if not needed.

Since: base-4.7.0.0

showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS #

Show a signed RealFloat value using standard decimal notation for arguments whose absolute value lies between 0.1 and 9,999,999, and scientific notation otherwise.

This behaves as showFFloat, except that a decimal point is always guaranteed, even if not needed.

Since: base-4.7.0.0

showHFloat :: RealFloat a => a -> ShowS #

Show a floating-point value in the hexadecimal format, similar to the %a specifier in C's printf.

>>> showHFloat (212.21 :: Double) ""
"0x1.a86b851eb851fp7"
>>> showHFloat (-12.76 :: Float) ""
"-0x1.9851ecp3"
>>> showHFloat (-0 :: Double) ""
"-0x0p+0"