Float package:base-compat

Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.
Trigonometric and hyperbolic functions and related functions. The Haskell Report defines no laws for Floating. However, (+), (*) and exp are customarily expected to define an exponential field and have the following properties:
  • exp (a + b) = exp a * exp b
  • exp (fromInteger 0) = fromInteger 1
a constant function, returning the number of digits of floatRadix in the significand
a constant function, returning the radix of the representation (often 2)
a constant function, returning the lowest and highest values the exponent may assume
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.
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.
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"
Efficient, machine-independent access to the components of a floating-point number.
The function decodeFloat applied to a real floating-point number returns the significand expressed as an Integer and an appropriately scaled exponent (an Int). If decodeFloat x yields (m,n), then x is equal in value to m*b^^n, where b is the floating-point radix, and furthermore, either m and n are both zero or else b^(d-1) <= abs m < b^d, where d is the value of floatDigits x. In particular, decodeFloat 0 = (0,0). If the type contains a negative zero, also decodeFloat (-0.0) = (0,0). The result of decodeFloat x is unspecified if either of isNaN x or isInfinite x is True.
encodeFloat performs the inverse of decodeFloat in the sense that for finite x with the exception of -0.0, uncurry encodeFloat (decodeFloat x) = x. encodeFloat m n is one of the two closest representable floating-point numbers to m*b^^n (or ±Infinity if overflow occurs); usually the closer, but if m contains too many bits, the result may be rounded in the wrong direction.
multiplies a floating-point number by an integer power of the radix