[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Floating point
- From: iain morland <iain@...>
- Date: Thu, 29 Oct 2015 17:16:53 +0000
Hi all,
If I assign a variable to the result of 23.2/0.2, and print that variable, Lua outputs 116.
However if I then use the same variable as the limit in an iterator, the iterator stops on the 115th repeat, rather than the 116th as expected.
So it therefore seems that the variable is a floating point number between 115 and 116.
I don’t understand why I can’t print the floating point value of this variable. I haven’t rounded or truncated it, so why does it print exactly 116, even though that’s not its value?
TIA,
Iain