|
GHC.Float | Portability | non-portable (GHC Extensions) | Stability | internal | Maintainer | cvs-ghc@haskell.org |
|
|
|
Description |
The types Float and Double, and the classes Floating and RealFloat.
|
|
Synopsis |
|
|
|
Documentation |
|
|
Trigonometric and hyperbolic functions and related functions.
Minimal complete definition:
pi, exp, log, sin, cos, sinh, cosh,
asin, acos, atan, asinh, acosh and atanh
| | Methods | | | Instances | |
|
|
|
Efficient, machine-independent access to the components of a
floating-point number.
Minimal complete definition:
all except exponent, significand, scaleFloat and atan2
| | Methods | | a constant function, returning the radix of the representation
(often 2)
| | | a constant function, returning the number of digits of
floatRadix in the significand
| | | a constant function, returning the lowest and highest values
the exponent may assume
| | | 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) <= m < b^d, where d is the value
of floatDigits x. In particular, decodeFloat 0 = (0,0).
| | | encodeFloat performs the inverse of decodeFloat
| | | the second component of decodeFloat.
| | | the first component of decodeFloat, scaled to lie in the open
interval (-1,1)
| | | multiplies a floating-point number by an integer power of the radix
| | | True if the argument is an IEEE "not-a-number" (NaN) value
| | | True if the argument is an IEEE infinity or negative infinity
| | | True if the argument is too small to be represented in
normalized format
| | | True if the argument is an IEEE negative zero
| | | True if the argument is an IEEE floating point number
| | | a version of arctangent taking two real floating-point arguments.
For real floating x and y, atan2 y x computes the angle
(from the positive x-axis) of the vector from the origin to the
point (x,y). atan2 y x returns a value in the range [-pi,
pi]. It follows the Common Lisp semantics for the origin when
signed zeroes are supported. atan2 y 1, with y in a type
that is RealFloat, should return the same value as atan y.
A default definition of atan2 is provided, but implementors
can provide a more accurate implementation.
|
| | Instances | |
|
|
|
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.
| Constructors | | Instances | |
|
|
|
Double-precision floating point numbers.
It is desirable that this type be at least equal in range and precision
to the IEEE double-precision type.
| Constructors | | Instances | |
|
|
|
Show a signed RealFloat value to full precision
using standard decimal notation for arguments whose absolute value lies
between 0.1 and 9,999,999, and scientific notation otherwise.
|
|
|
Constructors | FFExponent | | FFFixed | | FFGeneric | |
|
|
|
|
|
|
|
|
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
n >= 1 x = 0.d1d2...dn * (base**e) 0 <= di <= base-1
|
|
|
Converts a Rational value into any type in class RealFloat.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.0.0.0 |