by strenholme · 5y ago · 0 comments
a = a - b
b = a + b
a = b - a
XOR is simply addition or subtraction modulo 2 for each bit, so making the above XOR looks like this: a = a ^ b
b = a ^ b
a = b ^ aNot that this is important, but could hint why this trick is more often shown with XOR than with add/sub.