Hello all.
This is kind of a bug but It was simple enough to replicate that I didn't want to go through the hassle of reporting it in the bugs section and having to upload a capx.
The bug.
Whenever I add 0.1 to an instance variable, the value does not increase by exactly 0.1. Let an instance variable be 0. Add 0.1 and it becomes 0.1, add 0.1 again and it becomes 0.20000000000004, add 0.1 again and it becomes 0.300000000004 and sometimes adding 0.1 again makes the value exactly 0.4 or it continues to have those extra decimals. And after a lot of loops through adding 0.1, the value becomes totally different like 0.3999999999987 instead of 0.4 for example.
I found this out because I was setting a condition where the instance variable should be equal to 0.9, but it wouldn't fire and after checking in debug I saw that the value was actually 0.899999999999999 instead of 0.9. I don't get how such a thing could happen.
I tried multiplying and dividing by 10 and also with other objects' instance variables, but the same result.
Can anyone else replicate this and see if you're getting the same issue?
Thanks