variable-precision-0.1: variable-precision floating point

PortabilityBangPatterns, DeriveDataTypeable
Stabilityprovisional
Maintainerclaudiusmaximus@goto10.org
Safe HaskellSafe-Infered

Numeric.VariablePrecision.Float

Description

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.

Synopsis

Documentation

data VFloat p Source

A software implementation of floating point arithmetic, using a strict pair of Integer and Int, scaled similarly to decodeFloat.

recodeFloat :: (RealFloat a, RealFloat b) => a -> bSource

Convert between generic RealFloat types more efficiently than realToFrac.