.LT. meaning < .LE. <= .GT. > .GE. >= .EQ. = .NE. /=So you cannot use symbols like < or = for comparison in Fortran 77, but you have to use the correct two-letter abbreviation enclosed by dots! (Such symbols are allowed in Fortran 90, though.)
Logical expressions can be combined by the logical operators .AND. .OR. .NOT. which have the obvious meaning.
logical a, b a = .TRUE. b = a .AND. 3 .LT. 5/2The order of precedence is important, as the last example shows. The rule is that arithmetic expressions are evaluated first, then relational operators, and finally logical operators. Hence b will be assigned .FALSE. in the example above.
Logical variables are seldom used in Fortran. But logical expressions are frequently used in conditional statements like the if statement.
.TRUE. .AND. .FALSE. .OR. .TRUE. 2.LT.2 .OR. 5 .EQ. 11/2