BITXOR( ) Function

Example   See Also

Returns the result of a bitwise exclusive OR operation performed on two numeric values.

Syntax

BITXOR(nExpression1, nExpression2)

Returns

Numeric

Arguments

nExpression1, nExpression2

Specifies the numeric values on which the bitwise exclusive OR operation is performed. If nExpression1 and nExpression2 are not integers, they are converted to integers before the bitwise exclusive OR operation is performed.

Remarks

BITXOR( ) compares each bit in nExpression1 to the corresponding bit in nExpression2. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.

The following table shows the result of an exclusive OR operation on corresponding nExpression1 and nExpression2 bits:

nExpression1 bit nExpression2 bit Result bit
0 0 0
0 1 1
1 0 1
1 1 0