Logical operators can be used on integer or real numbers. The two values are first converted to logical (TRUE=1, FALSE=0) values, the operation is done, and the result is converted to an integer. When converting numbers to logical values, zero is converted to FALSE and non-zero is converted to TRUE. When converting the result to an integer, FALSE is converted to a zero, and TRUE is converted to a one.
Operator
Meaning
Example
Result
AND
Logical "and"
2 AND 3
1
EXOR
Logical "exclusive or"
2 EXOR 3
0
OR
Logical "or"
1 OR 0
1
NOT
Logical "not"
NOT 1
0
Binary functions perform bit-wise operations on integer numeric values. They may be used to manipulate bits or to perform conditional operations based on their logical result.