
The Magic of XOR - amzans
https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/xor.html
======
hexane360
Swapping doesn't just work with XORs: [http://chris-
taylor.github.io/blog/2013/02/25/xor-trick/](http://chris-
taylor.github.io/blog/2013/02/25/xor-trick/)

------
filereaper
If anyone else is looking for a compendium of these sorts of nifty tricks, I
highly recommend Hackers Delight by Hank Warren. Its a lovely book to have
when you're stuck in tight corners.

~~~
tinus_hn
It's nifty alright but be aware that are just about no situations where these
kinds of tricks are useful. It's clever but slower, more unclear and uses more
instructions which also is slower.

------
codespair
When I read the swapping capability... mind -> blown.

