Is this a bug ?

Hi everyone !

I’ve got a (very) small issue with my code. If I do this :

local varTest =  50.01 - 50

print("varTest = " … varTest)

I expect to see "varTest = 0.01 in the Corona Simulator Output. But instead, it returns “0.009999999”.

I may not be totally awake but… is it the expected behaviour ?

No.  Not a bug.  That is a natural side-effect of floating-point precision errors in CPUs.

Oh ok, I see ! Thanks for the link, now I understand :slight_smile:

No.  Not a bug.  That is a natural side-effect of floating-point precision errors in CPUs.

Oh ok, I see ! Thanks for the link, now I understand :slight_smile: