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

> X == Y: !(X < Y) && !(Y > X)

Only for totally ordered sets [1]. Floating-point numbers, for example, are not totally ordered, because !(NaN == NaN).

[1] https://en.wikipedia.org/wiki/Total_order



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

Search: