Floating point inaccuracies
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Floating point inaccuracies
- From: "Andreas Falkenhahn" <andreas@...>
- Date: 2010年11月27日 21:16:05 +0100
Hi,
why does this code not print "yo"?
---snip---
local x = 1.1
x = x + 0.1
if x == 1.2 then
print("yo")
end
---snap---
x is set to 1.2 but the if clause isn't entered. Can anybody explain why?
Tks,
Andreas