Sure, that’s the same for all floating point values on computers but this has nothing todo with what happens here.
It is a rounding “error” in a much more significant difference than any floating point number error and it is caused by just an implementation detail of how Corona stores alpha values internally (i.e. 8bit integers) and how it rounds changes to alpha coming from Lua (floats).
I.e. issue is not 1-0.5 = 0.49999999999999999999
It is
1 - 0.001 = 0.996
1 - 0.002 = 0.996
1 - 0.003 = 0.996
1 - 0.004 = 0.992
1 - 0.005 = 0.992
1 - 0.006 = 0.992
1 - 0.007 = 0.992
And the reason is simply that a range mapped from 0 to 1 to a byte means the smallest possible difference is 1/255, i.e. 0.004
(All numbers truncated as it makes the effect more clear)
It’s also not relevant if there are better approaches to fade an object in 10 seconds. When you stumble over such an “effect” it’s important to know what happens and why otherwise you may have a hard time finding your bugs when the logic of the code is, in theory, 100% correct.
This is a situation that can happen in countless situations it’s just rare in Lua as there’s no integer number type (not in Lua 5.1).