I used modulo (%) in Lua just a minute ago, and I noticed that it was somehow very inaccurate. I used it in World of Warcraft, but I would suggest that it is at least slightly updated.
Anyway, using the following example, the output will be 1;
print((0.6/(0.1^(2-1)))%1)
But when I use the following, it will return 0;
print((0.6*(10^(2-1)))%1)
And since I was educated, 0.6 / 0.1 should be equivalent to 0.6 * 10.
This is not a question or a problem, but I'm just interested in this reason. Inaccuracies in mathematics would be very destructive, in my opinion.
source share