Hacker News new | ask | show | jobs
by lelanthran 1446 days ago
> Off: floating point numbers can be used to store integer values, so equality comparison might be perfectly valid in some cases.

Yeah, but then you're having to learn all the special cases for when it silently gives wrong answers, and hope to hell that you didn't miss any.

Much better to have consistency and behave the same way all the time, than to optimise for 3 keystrokes and introduce all sorts of special exceptions that the programmer must memorise.