Developing Apama Applications > Apama EPL Reference > Expressions > Bitwise logical operators > Bitwise exclusive (xor)
Bitwise exclusive (xor)
The bitwise exclusive or operator xor produces a result by comparing all 64 bits of its left and right operands, which must be expressions of type integer, one bit at a time. For each bit in the two operands, the corresponding bit in the result value is set to 1 if either operand’s bit value is 1 and the other is 0 and set to 0 if both operand bit values are 0 or both are 1. In other words, the result bit is 1 if both bit values are different and 0 if they are the same.
Example
The following table illustrates this using 64-bit binary values.
 
a := 42;
0000000000000000000000000000000000000000000000000000000000101010
 
b := 642;
0000000000000000000000000000000000000000000000000000001010000010
 
a xor b
0000000000000000000000000000000000000000000000000000001010101000
Note that the expression a xor b yields the same result as not (a and b).
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.