How do I check to see whether a number has gone out of range? The check for positive infinity works, but the following doesn't:
if (x == numeric_limits<float>::quiet_NaN())
What happens is that the comparison always comes up true.
What's the trick to doing this check?