
This may be of interest if you want full-precision decimals: http://www.haskell.org/haskellwiki/Libraries_and_tools/Mathematics#Decimal_n... On Wed, Jan 16, 2013 at 7:30 AM, Patrick Mylund Nielsen < haskell@patrickmylund.com> wrote:
Fun with floating point!
# ghci GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> 9223372036854775807.0 == 9223372036854775808 True
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
On Wed, Jan 16, 2013 at 7:25 AM, ivan dragolov
wrote: 9.3 - (2 * 4.5) => 0.3000000000000007
I expected 0.3
?
-- Иван Драголов dragolov.net
GSM: 0888 63 19 46 GSM за SMS: 0878 82 83 93 facebook.com/ivan.dragolov twitter.com/dragolov
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe