Node:Bitwise exclusive OR (XOR/EOR), Next:Masks, Previous:Bitwise inclusive OR, Up:Truth tables and bit masks
Bitwise XOR operates on two values, for example 0 ^ 1
. The
result is 1 if the first value or the second value is 1, but
not if both are 1 (hence the name "exclusive OR"). As a
truth table this would be summarized as follows:
value1 | value2 | result
|
0 | 0 | 0
|
0 | 1 | 1
|
1 | 0 | 1
|
1 | 1 | 0
|