Bit Manipulation

Table

Operator & 1 ^
0:0 0 0 0
0:1 0 1 1
1:0 0 1 1
1:1 1 1 0

Swap

a = a ^ b;
b = a ^ b;
a = a ^ b;

XOR

a ^ 0 = a
a ^ a = 0

results matching ""

    No results matching ""