[Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007
Tom Davie
tom.davie at gmail.com
Wed Jan 16 14:55:57 CET 2013
Prelude> import Data.Ratio
Prelude Data.Ratio> 93 % 10 - (2 * 9 % 2)
3 % 10
Floating point sucks, avoid it if you can.
Thanks
Tom Davie
On 16 Jan 2013, at 13:25, ivan dragolov <ivan at dragolov.net> 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130116/4834b0f8/attachment.htm>
More information about the Haskell-Cafe
mailing list