Float package:base

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.
The types Float and Double, the classes Floating and RealFloat and casting between Word32 and Float and Word64 and Double.
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 32-bit floating point number
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
floatToDigits takes a base and a non-negative RealFloat number, and returns a list of digits and an exponent. In particular, if x>=0, and
floatToDigits base x = ([d1,d2,...,dn], e)
then
  1. n >= 1
  2. x = 0.d1d2...dn * (base**e)
  3. 0 <= di <= base-1
Truncates a Float# value to the nearest Int#. Results are undefined if the truncation if truncation yields a value outside the range of Int#.
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
Constructs the Float type