3 ms·
> I've no idea what problem was solved by the current weird IEEE behavior. The same problem that's solved by having a lot of proofs say "for all y != 0, ..." I
by morelisp 4y ago
> I've no idea what problem was solved by the current weird IEEE behavior.
The same problem that's solved by having a lot of proofs say "for all y != 0, ..." If NaN == NaN, then you can no longer assume that x/z == y/z implies x == y. Which is also a fundamental (though non-axiomatic) result of arithmetic!
NaN is an effort to represent partial functions in code that usually expects totality. It's not the best way but it's pretty good, and making NaN == NaN is also not how we'd do it with decades of hindsight.