Hacker News new | past | comments | ask | show | jobs | submit login

If you need XOR of two boolean values, you can just "z = x != y". That's my favorite XOR trick, as it's easily understandable and readable.



x!=y is itself calculated using XOR.




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

Search: