<div dir="ltr">Announcing deka, a library for decimal arithmetic.<div><br></div><div>Why decimal arithmetic is important is discussed at length at</div><div><br></div><div><a href="http://speleotrove.com/decimal/">http://speleotrove.com/decimal/</a></div>
<div><br></div><div>but for a short explanation, go into ghci and type:</div><div><br></div><div>print $ 0.1 + 0.1 + 0.1</div><div><br></div><div>This is 0.3, right? But on my machine I get 0.3 plus a small fraction, which is simply not acceptable for applications where it is essential to get exact results, such as financial applications.<br>
<div><br></div><div>deka is a binding to the decNumber C library, a thoroughly tested and fast implementation of decimal arithmetic.  deka is fully tested and I encourage you to run the tests using the usual "cabal test" method.</div>
<div><br></div><div>deka is available at<div><br></div><div><a href="http://hackage.haskell.org/package/deka">http://hackage.haskell.org/package/deka</a><br></div><div><br></div><div>and is on Github at</div><div><br></div>
<div><a href="https://github.com/massysett/deka">https://github.com/massysett/deka</a><br></div><div><br></div><div>Because deka is a binding to the decNumber C library, first you will need to install decNumber.  An easy to install version with the GNU autotools is at:</div>
<div><br></div><div><a href="https://github.com/massysett/decnumber/releases">https://github.com/massysett/decnumber/releases</a><br></div><div><br></div><div>decNumber's website is at</div><div><br></div><div><a href="http://speleotrove.com/decimal/decnumber.html">http://speleotrove.com/decimal/decnumber.html</a><br>
</div></div></div><div><br></div><div>A literate Haskell file illustrating the use of deka is available at</div><div><br></div><div><a href="https://github.com/massysett/deka/blob/master/lib/Data/Deka/Docs/Examples.lhs">https://github.com/massysett/deka/blob/master/lib/Data/Deka/Docs/Examples.lhs</a><br>
</div></div>