Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  How to improve the accuracy of floating      point
      calculation? (KC)


----------------------------------------------------------------------

Message: 1
Date: Tue, 5 Feb 2013 17:58:33 -0800
From: KC <[email protected]>
Subject: Re: [Haskell-beginners] How to improve the accuracy of
        floating        point calculation?
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <camlkxykyk1j7tuecb6hdgt9b82mby4d+3wrcolxwjbd3gkd...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

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
<[email protected]> 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
> midpoint:
> [0.1,0.2,0.30000000000000004,0.4000000000000001,0.5000000000000001,0.6000000000000001,0.7000000000000001,0.8,0.9,1.0]
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners



-- 
--
Regards,
KC



------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 56, Issue 11
*****************************************

Reply via email to