Branch is not true when it should be

So the code is suppost to add up the “Progress bar add” value on every E button activate then it should check if the value is equal, if it is it should print the “DONE” string but it doesn’t. Any ideas why?


When I check the print of the value, it works but yeah it doesn’t work on the equal

As a rule of thumb, get used to using:

image

When comparing floats.

Floating-point error mitigation is the minimization of errors caused by the fact that real numbers cannot, in general, be accurately represented in a fixed space. By definition, floating-point error cannot be eliminated, and, at best, can only be managed.


Alternatively, use ints:

That works, thank you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.