Serves as a general bitwise Boolean function
(Boole operator int1 [int2 ...])
Successive integer arguments are bitwise (logically) combined based on this function and on the following truth table:
Boolean truth table |
||
---|---|---|
Int1 |
Int2 |
operator bit |
0 |
0 |
8 |
0 |
1 |
4 |
1 |
0 |
2 |
1 |
1 |
1 |
Each bit of int1 is paired with the corresponding bit of int2, specifying one horizontal row of the truth table. The resulting bit is either 0 or 1, depending on the setting of the operator bit that corresponds to this row of the truth table.
If the appropriate bit is set in operator, the resulting bit is 1; otherwise the resulting bit is 0. Some of the values for operator are equivalent to the standard Boolean operations AND, OR, XOR, and NOR.
The following specifies a logical AND of the values 12 and 5:
Command: (Boole 1 12 5)
4
The following specifies a logical XOR of the values 6 and 5:
Command: (Boole 6 6 5)
3
You can use other values of operator to perform other Boolean operations for which there are no standard names. For example, if operator is 4, the resulting bits are set if the corresponding bits are set in int2 but not in int1:
Command: (Boole 4 3 14)
12