[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: why 0.1+0.2-0.3~=0
- From: Robert Virding <robert.virding@...>
- Date: Tue, 13 Mar 2012 10:59:07 -0000 (GMT)
----- Original Message -----
> On Tue, Mar 13, 2012 at 12:37, Karol Bielecki
> <karol.bielecki@tagmet.com.pl> wrote:
> > in my program and on the website http://www.lua.org/cgi-bin/demo
> >
> >
> > tmp=0.1+0.2-0.3
> > print(tmp)
> >
> > gives
> >
> > 5.5511151231258e-17
> >
>
> http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
That is a wonderful paper which everyone definitely should read if they ever come near floating point arithmetic.
Robert