I apologize if this is asked in a strange way, this is my first time asking a question here. In swapping two variables, I came across this line after a google search:
x = x^i^(i = x);
In context, I have two ints, i and x, and this line swaps their values. I've been trying to understand the logic behind this and I can't quite get it. The closest I've come is realizing that, on a mathematical scale, they're equal. Throwing it into an online calculator shows that both sides equal x. The closest thing I can think of is:
(i = x) is false, so it's a zero?
so i^0 is 1
so x = x^1
But even with this, I still can't understand how this swaps the two numbers.