All Boolean operators return 1 (‘nonzero’), if the condition is met (i.e., True) and 0 if the condition is not met (i.e., False).
The operator ‘not’ can be used to negate an expression, but remember to use parenthesis, since ‘not’ is stronger (i.e., of higher precedence) than all other operators.
For example: The expression: ‘not 1 > -1’
|
The other Boolean operators are all weaker (i.e., of lower precedence) than the arithmetic operators.
Boolean Operator |
Boolean Operator Description |
Not Operator: not |
Nonzero (i.e., True), if the expression after ‘not’ is zero, otherwise zero. Note: The ‘not’ operator has the highest precedence (i.e., the strongest) and may require the use of parenthesis to ensure that it is evaluated as expected. |
Relational Boolean Operators: =, <, <=, >, >=, <> |
The Value comparison operators: § Equal (=) § Less Than (<) § Less Than or Equal (<=) § Greater Than (>) § Greater Than or Equal (>=) § Not Equal (<>) |
Logical And Operator: and |
Evaluates to Nonzero (i.e., True), if the expressions on either side of the ‘and’ operator are both nonzero. |
Logical Or Operator: or |
Evaluates to Nonzero (i.e., True), if one or both of the expressions on either side of ‘or’ is nonzero. |