You can't compare floating point values like this. Instead of checking `a == b`, you have to check `abs(a - b) < eps` for a sufficiently small `eps` (generally `1e-15` or so I think).