[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: why 0.1+0.2-0.3~=0
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 13 Mar 2012 08:15:47 -0300
> tmp=0.1+0.2-0.3
> print(tmp)
> 5.5511151231258e-17
This is *not* a bug in Lua; it's inherent to the native
floating-point arithmetic that Lua uses. See
http://lua-users.org/wiki/FloatingPoint
http://docs.python.org/tut/node16.html