[Haskell-beginners] How to improve the accuracy of floating point calculation?
kc1956 at gmail.com
Wed Feb 6 02:58:33 CET 2013
I should have been more precise; I truncated my own remarks.
0.1 cannot be represented exactly in floating point because it is not
a power of two; whereas, 0.5 is 1/2 = 2^(-1).
Floating point stores its mantissa as binary bits.
On Tue, Feb 5, 2013 at 4:47 PM, Mateusz Kowalczyk
<fuuzetsu at fuuzetsu.co.uk> wrote:
> I thought that KC was asking why is 0.5 not displayed as 0.5 when it's
> supported by the IEEE754. Even if that wasn't question, it is my
> question now.
> IEEE754 is capable of representing 0.5 with perfect precision; in fact,
> it would be `00111111000000000000000000000000'.
> My question is why [0.1, 0.2 .. 1.0] comes up with an imprecise
> Beginners mailing list
> Beginners at haskell.org
More information about the Beginners