Portability | BangPatterns, DeriveDataTypeable |
---|---|
Stability | provisional |
Maintainer | claudiusmaximus@goto10.org |
Safe Haskell | Safe-Infered |
Variable precision software floating point based on (Integer, Int)
as
used by decodeFloat
.
Accuracy has not been extensively verified, and termination of numerical algorithms has not been proven.
floatRange
is arbitrarily limited to mitigate the problems that
occur when enormous integers might be needed during some number
type conversions (worst case consequence: program abort in gmp).
No support for infinities, NaNs, negative zero or denormalization:
- exponent overflow throws an error instead of resulting in infinity,
- exponent underflow traces a warning and results in zero instead of resulting in a denormalized number.
Some operations throw errors instead of resulting in an infinity or NaN:
The Floating
instance so far only implements algorithms for:
with other Floating
methods transitting via Double
, also log
precision is limited due to internal use of log 2 :: Double
.
- data VFloat p
- recodeFloat :: (RealFloat a, RealFloat b) => a -> b
- module Numeric.VariablePrecision.Precision
- module TypeLevel.NaturalNumber.ExtraNumbers
Documentation
A software implementation of floating point arithmetic, using a strict
pair of Integer
and Int
, scaled similarly to decodeFloat
.
Typeable1 VFloat | |
VariablePrecision VFloat | |
HasPrecision VFloat | |
Eq (VFloat p) | |
NaturalNumber p => Floating (VFloat p) | |
NaturalNumber p => Fractional (VFloat p) | |
Data p => Data (VFloat p) | |
NaturalNumber p => Num (VFloat p) | |
Ord (VFloat p) | |
NaturalNumber p => Read (VFloat p) | |
NaturalNumber p => Real (VFloat p) | |
NaturalNumber p => RealFloat (VFloat p) | |
NaturalNumber p => RealFrac (VFloat p) | |
NaturalNumber p => Show (VFloat p) | |
NaturalNumber p => DispFloat (VFloat p) | |
NaturalNumber p => FShow (VFloat p) |
recodeFloat :: (RealFloat a, RealFloat b) => a -> bSource
Convert between generic RealFloat
types
more efficiently than realToFrac
.