The following relational operators deliver a logical result:
for example,
i .GT. 12
is an expression delivering a .TRUE. or .FALSE. result.
These above operators are equivalent to the following:
for example,
i > 12
Both sets of symbols may be used in a single statement.
Relational operators:
(bool .NE. .TRUE.)
is not a valid expression but,
(.NOT.bool)is.
Consider,
bool = i.GT.j IF (i.EQ.j) c = D IF (i == j) c = D
The example demonstrates,
When using real-valued expressions (which are approximate) .EQ. and .NE. have no real meaning.
REAL :: Tol = 0.0001 IF (ABS(a-b) .LT. Tol) same = .TRUE.
Return to corresponding overview page