[Haskell-cafe] [ANN] deka - decimal arithmetic

Omari Norman omari at smileystation.com
Sat Feb 8 20:46:49 UTC 2014


On Sat, Feb 8, 2014 at 3:39 PM, Nicolas Trangez <nicolas at incubaid.com>wrote:

> Note there's some existing support for this in `base`:
>
> On Sat, 2014-02-08 at 15:06 -0500, Omari Norman wrote:
> > but for a short explanation, go into ghci and type:
> >
> > print $ 0.1 + 0.1 + 0.1
>
> λ print $ (0.1 + 0.1 + 0.1 :: Double)
> 0.30000000000000004
>
> λ :m + Data.Fixed
>

Key word there is "Fixed"; deka supports floating point with up to 34
digits of precision but, yes, Data.Fixed does solve some of this problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140208/1fde9055/attachment.html>


More information about the Haskell-Cafe mailing list