Skip to main content

4.5) Making Decisions


Shown in the table are some of the decisions that you can test for in Fortran.

Test Description
> Tests if LHS is greater than RHS, e.g. a > b?
< Tests if LHS is less than RHS, e.g. a < b?
>= Tests if LHS is greater or equal to RHS
<= Tests if LHS is less than or equal to RHS
== Tests if LHS is equal to RHS
/= Tests if LHS is not equal to RHS

This is the list of the commonly used tests that can be used in if statements.

Some compilers in Fortran 77 will only accept decisions in the following forms.

Fortran 95 Fortran 77
> .gt.
< .lt.
>= .ge.
<= .le.
== .eq.
/= .ne.