Logical
A logical expression (logical_expr),
when evaluated, produces a result of type logical. The form of a logical
expression is:
The form of a logical_disjunct is:
The form of a logical_term is:
The form of a logical_factor is:
logical_primary is a primary of type logical.
rel_expr is a relational expression.
The logical operators are:
| Logical Operator | Representing | Precedence |
|---|---|---|
| .NOT. | Logical negation | First (highest) |
| .AND. | Logical conjunction | Second |
| .OR. | Logical inclusive disjunction | Third |
| .XOR. 1 | Logical exclusive disjunction | Fourth (lowest) |
| .EQV. | Logical equivalence | Fourth (lowest) |
| .NEQV. | Logical nonequivalence | Fourth (lowest) |
Note:
- XL Fortran logical operator.
The .XOR. operator
is treated as an intrinsic operator only when the -qxlf77=intxor compiler
option is specified. (See the -qxlf77 option in the XL Fortran Compiler Reference
for details.) Otherwise, it is treated as a defined operator. If it
is treated as an intrinsic operator, it can also be extended by a
generic interface. 
The precedence of the operators determines the order of evaluation when a logical expression containing two or more operators having different precedences is evaluated. For example, evaluation of the expression A.OR.B.AND.C is the same as evaluation of the expression A.OR.(B.AND.C).



