Next: Intrinsic Logical Operations
Up: Expressions and Assignment
Previous: Concatenation
The following relational operators deliver a logical result:
- .GT. -- greater than.
- .GE. -- greater than or equal to.
- .LE. -- less than or equal to.
- .LT. -- less than.
- .NE. -- not equal to.
- .EQ. -- equal to.
for example,
i .GT. 12
is an expression delivering a .TRUE. or .FALSE. result.
These above operators are equivalent to the following:
- > -- greater than.
- >= -- greater than or equal to.
- <= -- less than or equal to.
- < -- less than.
- /= -- not equal to.
- = -- equal to.
for example,
i > 12
Both sets of symbols may be used in a single statement.
Relational operators:
Consider,
bool = i.GT.j
IF (i.EQ.j) c = D
WHERE (a.NE.0) a = 1/a
The example demonstrates,
- simple logical assignment using a relational operator,
- an IF statement using a relational operator,
- a WHERE statement using a relational operator (in an array
context).
Next: Intrinsic Logical Operations
Up: Expressions and Assignment
Previous: Concatenation
Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 15:03:35 GMT 1996Not for commercial use.