a xor b
a xor b performs a logical Exclusive OR between a and b. If a or b are not booleans, 0 represents a logical false and any nonzero value represents a logical true. The truth table for this operator is shown below.
a |
b |
a xor b |
false |
false |
false |
false |
true |
true |
true |
false |
true |
true |
true |
false |
a and b must be scalars.