[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Precision
- From: Thiago Conde Figueiro <thiago@...>
- Date: Thu, 30 Aug 2001 10:03:49 -0300
Could anyone tell me if this is supposed to happen? It didn't look very good on my numerical analysis class. :-)
[tcs@is32 tmp]$ cat teste.lua
local a = -1
while a < 1 do
print(a)
a = a +0.15
end
[tcs@is32 tmp]$ lua
Lua 4.0 Copyright (C) 1994-2000 TeCGraf, PUC-Rio
> dofile("teste.lua")
-1
-0.85
-0.7
-0.5499999999999999
-0.3999999999999999
-0.2499999999999999
-0.09999999999999992
0.05000000000000007
0.2000000000000001
0.3500000000000001
0.5000000000000001
0.6500000000000001
0.8000000000000002
0.9500000000000002
[]'s,
Thiago.