Closed WraithGlade closed 2 years ago
In the list of examples provided by the "Lua quick start guide", one can find the following excerpt:
-- %.0f placeholder truncates real numbers print(("%.0f"):format(1.5)) --> 1
This statement is false however. It prints 2, clearly engaging in rounding behavior.
Other test cases (e.g. 5.999999, etc) also round, not truncate.
Perhaps this is a remnant of an old version of Lua. I haven't touched Lua in many years, but trying to freshen up now.
I'm not sure if this should be reported on Git, but it was the only avenue for reporting I found in a few minutes, so here I am.
My apologies if this is not the correct place for reporting it. I don't want to waste a lot of time on it since it is a small thing.
Thank you for the report! This should be fixed in https://github.com/pkulchenko/ZeroBraneEduPack/commit/ff97a4e4a5a8385b594655f424d27147a6619b37.
In the list of examples provided by the "Lua quick start guide", one can find the following excerpt:
This statement is false however. It prints 2, clearly engaging in rounding behavior.
Other test cases (e.g. 5.999999, etc) also round, not truncate.
Perhaps this is a remnant of an old version of Lua. I haven't touched Lua in many years, but trying to freshen up now.
I'm not sure if this should be reported on Git, but it was the only avenue for reporting I found in a few minutes, so here I am.
My apologies if this is not the correct place for reporting it. I don't want to waste a lot of time on it since it is a small thing.