[Haskell] Announce: Decimal arithmetic package

Paul Johnson paul at cogito.org.uk
Sun Mar 30 14:57:18 EDT 2008


I've just uploaded version 0.1.0 of a decimal arithmetic package to 
Hackage.  Decimal numbers are stored as an Integral mantissa and a Word8 
exponent, where the number stored is mantissa * 10^(-exponent).  In 
other words the exponent is the number of decimal places stored.  There 
are also routines for partitioning a value such that the sum of the 
parts is equal to the original value.  This is useful in financial 
arithmetic.

This came out of my ongoing work on an AMQP binding for Haskell.  
Version 0-10 of the AMQP spec includes decimal fractions defined in this 
way for financial applications, so I thought I'd make a proper job of it.

A darcs repository will be set up shortly.

Paul.



More information about the Haskell mailing list