variable-precision-0.4: variable-precision floating point

PortabilityBangPatterns, DeriveDataTypeable, Rank2Types, MonoLocalBinds
Stabilityunstable
Maintainerclaude@mathr.co.uk
Safe HaskellNone

Numeric.VariablePrecision.Fixed

Description

Variable precision software fixed point based on Integer.

Accuracy has not been extensively verified.

Example:

 reifyPrecision 1000 $ \prec ->
    show $ auto (355 :: VFixed N15) / 113 `atPrecision` prec

Synopsis

Documentation

data DFixed Source

A concrete format suitable for storage or wire transmission.

Constructors

DFixed 

fromDFixed :: NaturalNumber p => DFixed -> Maybe (VFixed p)Source

Thaw a DFixed. Results in Nothing on precision mismatch.

withDFixed :: DFixed -> (forall p. NaturalNumber p => VFixed p -> r) -> rSource

Thaw a DFixed to its natural precision.