Bit operators work with the individual bits of the operands. Before the whole expression is evaluated, all operands involved are converted to the size of the longest operands involved according to the rules for source field type x or xstring. This means that shorter operands are filled out to the right with hexadecimal 0. Linking two operands with BIT-AND, BIT-OR, and BIT-XOR has a result of this length, as each individual bit is set according to the table from the bits of the corresponding positions in the operands. BIT-NOT changes the bits of the operands to its right as shown in the table.
x | y | BIT-NOT x | x BIT-AND y | x BIT-XOR y | x BIT-OR y |
0 | 0 | 1 | 0 | 0 | 0 |
0 | 1 | 1 | 0 | 1 | 1 |
1 | 0 | 0 | 0 | 1 | 1 |
1 | 1 | 0 | 1 | 0 | 1 |
The order of the columns in the table reflects the priority of the bit operators. The operator BIT-NOT has the highest, and BIT-OR the lowest priority. Within one level of parentheses, (see below), the results of operators with higher priority are formed before the results with operators of a lower priority. For consecutive operators of the same priority, the evaluation is carried out from left to right, except for the operator BIT-NOT, which is executed from right to left.
The end result of the whole expression is finally converted into the length of the data object result according to the rules for source field type x or xstring.