There is a widespread misconception about floating-point arithmetic errors and some people fear that even a simple increment can go weird with floating-point numbers. The fact is that, when you use a double to represent an integer, there is no rounding error at all (unless the number is greater than 100,000,000,000,000). Specifically, a Lua number can represent any long integer without rounding problems. Moreover, most modern CPUs do floating-point arithmetic as fast as (or even faster than) integer arithmetic.
Tldr: Lua can handle big numbers without floating-point errors.
However, in Roblox, I get these errors pretty often. Is there some kind of disconnect mutating the numbers in Roblox (For example, NumberValue.Value or Integer.Value properties)?
Is Lua's manual just wrong here? I'm just interested in the validity, I'm not sure I've ever heard anyone say anything about it or backed this statement up.
(Definitely have heard people warning about floating-point errors, of course.)
Also, does this apply to decimals and fractions as well?
Source: https://www.lua.org/pil/2.3.html

1 comment
wut