Q
In C++ or Java, what does the expression NaN == NaN evaluate to?
-
A
Undefined behavior
-
B
true
-
C
false
-
D
It throws an exception
Correct Answer:
C. false
Explanation:
Under IEEE 754, NaN compares unequal to everything, including itself. x != x is a common test for NaN.