Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: