A.2.2.3 Logical Operators

The following logical operators are available:


Table A.6: Logical operators.
Operator name Logical function
&& AND
|| OR
! NOT

These operators can be used in logical expressions where all operands must be Boolean values. The result of the operation will again be a Boolean value: true or false. Some examples:

!true                      // -> false
(1 < 2) || (7 >= 2)        // -> true
!0 && (5 > 3)              // -> true

An Integer or Real operand equal to 0 will be treated as false, any other value as true. For Complex numbers only the value 0 + 0 j means false. Any other value will be treated as true.

Robert Klima 2003-02-06