Next: Bitwise Operators
Up: Using MathMaps
Previous: Logical Operators

## Relational Operators

Relational operators return the logical result (0 or 1) of comparing the values of two floating-point values for equality or inequality. The bad value may also be returned if either argument is bad .

The following relational operators are available:

• X1 .EQ. X2: Tests whether X1 equals X2. (The synonym "==" is also provided for compatibility with C.)

• X1 .NE. X2: Tests whether X1 is unequal to X2. (The synonym "!=" is also provided for compatibility with C.)

• X1 .GT. X2: Tests whether X1 is greater than X2. (The synonym " " is also provided for compatibility with C.)

• X1 .GE. X2: Tests whether X1 is greater than or equal to X2. (The synonym " =" is also provided for compatibility with C.)

• X1 .LT. X2: Tests whether X1 is less than X2. (The synonym " " is also provided for compatibility with C.)

• X1 .LE. X2: Tests whether X1 is less than or equal to X2. (The synonym " =" is also provided for compatibility with C.)

Note that relational operators cannot usefully be used to compare values with the bad value (representing missing data), because the result is always bad . The ISBAD() function should be used instead.

Note, also, that because logical operators can operate on floating point values, care must be taken to use parentheses in some cases where they would not normally be required in Fortran. For example, the expression:

```         .NOT.  A .EQ. B
```

must be written:

```         .NOT. ( A .EQ. B )
```

to prevent the .NOT. Operator from associating with the variable A.

Next: Bitwise Operators
Up: Using MathMaps
Previous: Logical Operators

KAPPA --- Kernel Application Package