...then use NaN = 0/0.
> This is a popular myth, but it is false. There are circumstances in which exact equality comparisons in floating-point are perfectly appropriate.
Can you give an example where == is appropriate, but where you want NaN == NaN to be false?
> No; if it were we would have +0 != -0. You’re looking for totalOrder(x,y) or a related predicate.
Exactly, +0 == -0 should be false too. totalOrder(x,y) is what == should have been (or at least the equality part of it).
p.s. An arguably more serious issue with IEEE floats is rounding modes. The round up/round down modes are tantalizingly close to providing the ability to do ironclad approximate real arithmetic in the sense that you could give upper/lower bounds on the exact value. The problem is that the rounding modes only involve giving an upper/lower bound on the output given an exact input, rather than an upper/lower bound on the output given an upper/lower bound on the input. So it's not compositional which means you can't guarantee anything.