Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Logical operators

&pagelevel(4)&pagelevel

Logical operators link together two Boolean expressions (exception: NOT. This operator applies only to a single Boolean expression).

The result yielded by linking logical operators is always a Boolean value (TRUE or FALSE) that can be addressed by means of one of the names reserved for Boolean constants.

Operation

Operator

Negation

NOT

Or

OR

And

AND

Either Or
(= exclusive or)

XOR

Rules:

  • The rules for logic operations apply.

  • NOT inverts the value of an expression.

Example

/A = TRUE
/B = 4
/C = 20
/D = A OR (B > C)
/E = A AND (B > C) 

Variable D is assigned the value TRUE, since one of the operands has the value TRUE in the OR operation.
Variable E is assigned the value FALSE, since only one of the two operands of the AND operation has the value TRUE.