[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: bug report: string.format rounding error
- From: Thomas Jenni <Thomas.Jenni@...>
- Date: Wed, 18 Sep 2019 06:47:16 +0000
In Lua 5.3.5 on a 64-bit machine (macOS 10.14.6), the following two lines produce different results
print(string.format("%.2f",1.625000000000001))
1.63
print(string.format("%.2f",1.625000000000000))
1.62
It seems unclear to me, why in the latter case 1.625 is rounded to 1.62.
Thanks for fixing this bug.
best regards
T. Jenni