Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
This module implements the decimal interchange format encodings described
in IEEE 754-2008, including the decimal32, decimal64, and decimal128
formats, as well as arbitrary width decimal{k} formats through the use of
Format
with KPlus32
and/or KTimes2
. For example, to use a
decimal96 format:
type Decimal96 = ExtendedDecimal (Format (KPlus32 K64) DecimalCoefficient)
Currently only a decimal encoding of coefficients is implemented, but a binary encoding may be added in the future.
- type Decimal32 = ExtendedDecimal Pdecimal32
- type Decimal64 = ExtendedDecimal Pdecimal64
- type Decimal128 = ExtendedDecimal Pdecimal128
- type Pdecimal32 = Format K32 DecimalCoefficient
- type Pdecimal64 = Format K64 DecimalCoefficient
- type Pdecimal128 = Format K128 DecimalCoefficient
- data Format k c
- class Parameters k
- data K32
- type K64 = KPlus32 K32
- type K128 = KTimes2 K64
- data KPlus32 k
- data KTimes2 k
- data DecimalCoefficient
- data BinaryCoefficient
Primary convenience types
type Decimal32 = ExtendedDecimal Pdecimal32 Source #
A decimal floating point number with 7 digits of precision, rounding half even, and a 32-bit encoded representation using the decimal32 interchange format (with a decimal encoding for the coefficient)
type Decimal64 = ExtendedDecimal Pdecimal64 Source #
A decimal floating point number with 16 digits of precision, rounding half even, and a 64-bit encoded representation using the decimal64 interchange format (with a decimal encoding for the coefficient)
type Decimal128 = ExtendedDecimal Pdecimal128 Source #
A decimal floating point number with 34 digits of precision, rounding half even, and a 128-bit encoded representation using the decimal128 interchange format (with a decimal encoding for the coefficient)
Precision types
type Pdecimal32 = Format K32 DecimalCoefficient Source #
A type with Precision
instance specifying decimal32 interchange
format parameters (using a decimal encoding for the coefficient) having an
effective precision of 7 decimal digits
type Pdecimal64 = Format K64 DecimalCoefficient Source #
A type with Precision
instance specifying decimal64 interchange
format parameters (using a decimal encoding for the coefficient) having an
effective precision of 16 decimal digits
type Pdecimal128 = Format K128 DecimalCoefficient Source #
A type with Precision
instance specifying decimal128 interchange
format parameters (using a decimal encoding for the coefficient) having an
effective precision of 34 decimal digits
Interchange format types
A type (with a Precision
instance) for specifying interchange format
parameters k
and coefficient encoding c
Parameters k => Binary (Decimal (Format k DecimalCoefficient) r) Source # | A |
Parameters k => FinitePrecision (Format k c) Source # | |
Parameters k => Precision (Format k c) Source # | This |
Format parameters
class Parameters k Source #
Interchange format parameters used to define an encoding and derive the format's precision and Emax
paramK32
Parameters K32 Source # | |
Parameters k => Parameters (KTimes2 k) Source # | |
Parameters k => Parameters (KPlus32 k) Source # | |
Parameters for a decimal{k
+ 32} interchange format
Parameters k => Parameters (KPlus32 k) Source # | |
Parameters for a decimal{k
× 2} interchange format
Parameters k => Parameters (KTimes2 k) Source # | |
Coefficient encodings
data DecimalCoefficient Source #
Specify a decimal encoding for the coefficient.
Parameters k => Binary (Decimal (Format k DecimalCoefficient) r) Source # | A |
data BinaryCoefficient Source #
Specify a binary encoding for the coefficient (currently unimplemented).