5 ms·
IEEE 754 specifies some not-a-number values X that are not equal to themselves; i.e. such that X != X. The bit pattern is actually not equal to itself: if we c
by kazinator 6y ago
IEEE 754 specifies some not-a-number values X that are not equal to themselves; i.e. such that X != X.
The bit pattern is actually not equal to itself: if we compared X bitwise, like with memcmp in C, it would be equal: memcmp(&X, &X, sizeof X) == 0.
That obnoxiously violates the philosophical Law of Identity, as we would like to see it applied in programming languages.
https://en.wikipedia.org/wiki/Law_of_identity https://en.wikipedia.org/wiki/Law_of_identity