next up previous contents
Next: Intrinsic Logical Operations Up: Expressions and Assignment Previous: Intrinsic Numeric Operations

 

Relational Operators

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:

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 gif


next up previous contents
Next: Intrinsic Logical Operations Up: Expressions and Assignment Previous: Intrinsic Numeric Operations

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.