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

I don't see how you could interpret "a != b != c" as equivalent to "not (a == b == c)" in the first place. In the first expression a doesn't equal b and b doesn't equal c (no restriction on a and c). In the second expression you could have a == b, but b != c (and vice versa), clearly that's not equivalent to the first expression.


"a == b" is the same as "not (a != b)"

Maybe I'm simple minded though.


If you treat each "!" as a NOT, then (a != b != c) has two NOTs, but !(a == b == c) has a single one, so this is a bit like expecting that !(a && b) is the same as (!a && !b).


"a == b == c" translates to "a == b and b == c", similarly "a != b !=c" translates to "a != b and b != c"




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

Search: