bitxor()

Scalar. Returns the results of performing a bitwise exclusive OR (XOR) operation on two expressions.

Syntax

bitxor ( expression1, expression2 )

Parameters

expression1

Expression that simplifies to an integer or a long (must be the same datatype as expression2)

expression2

Expression that simplifies to an integer or a long (must be the same datatype as expression1)

Usage

The function performs the logical XOR operation on each pair of corresponding bits. The result for the pair of bits is 1 if the two bits are different, or 0 if they are the same. Using bitxor() on the same expression yields 0. The function returns the same datatype as its arguments.

Example

bitxor (3, 3) returns 0.

bitxor (10, 15) returns 5, or in binary, bitxor (1010, 1111) returns 0101. The user cannot specify binary directly.