Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
aljarry
on Jan 18, 2021
|
parent
|
context
|
favorite
| on:
That XOR Trick (2020)
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.
abhishekjha
on Jan 18, 2021
[–]
x!=y is itself calculated using XOR.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: