The bitwise "exor" operator (^) is to perform a bitwise xOR on two expressions. How to use:
The code copy is as follows:
result = expression1 ^ expression2
where result is any variable.
expression1 is any expression.
expression2 is any expression.
Bitwise "exclusive" operator description
The ^ operator looks at the values of the binary notation of both expressions and performs a bitwise exclusive OR. The results of this operation are as follows:
0101 (expression1)
1100 (expression2)
----
1001 (Result)
The result is only 1 if and only if only one bit of an expression is 1. Otherwise, the bit of the result is 0.