I'm having a hard time comparing two floats:
float(21) / float(120) == 0.175
It should be true, but godot says it's false.
Just to be clear,
print(float(21) / float(120)) outputs
typeof(float(21) / float(120)) is the same as
Certainly these two should be true:
(float(21) / float(120)) * 1000 == float(0.175) * 1000
But they're not, however they provide a hint of what's going on:
175 == 174.999997
0.175 * 1000 was actually the culprit. I would had been ok with comparing it to
0.175 / 1.0 however it won't work.
I think I'll typecast the values a strings, but am I missing something? Doesn't look like godot supports big decimal (though it shouldn't be necessary for something so trivial).