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

mathematically, yes. In practice, NaN!=NaN just kills any hope of having any amount of sanity for operations that don't care about floating-point and just want to generally compare things. It's not very nice to say "sorting, hashmaps & hashsets containing NaNs cause the entire operation/structure to be completely undefined behavior", especially given that NaNs kind exist to allow noticing errors, not cause even more of them.


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

Search: