Hacker News new | ask | show | jobs
by the5avage 599 days ago
"a == b" is the same as "not (a != b)"

Maybe I'm simple minded though.

2 comments

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"