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

None of those are true when using `==` either.

The NaN example comes directly from IEEE754

The others are based on the fact that the two sides are not referring to the same object. C "equivalents" of your examples:

    int x[0], y[0]; x == y; // false
    typedef struct {} empty_t; empty_t *x, *y; x == y; // false
    int x[] = { 1 }, y[] = { 1 }; x == y; // false
    int x[] = { 0 }, y[] = { 0 }; x == y; // false


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

Search: