Arithmetic IF

From Wikipedia, the free encyclopedia


The arithmetic IF statement in early versions of Fortran, including Fortran 66, was a three-way conditional statement. Instead of the common if statements seen in other languages, the statement defines three different branches depending on whether the result of an expression was negative, zero, or positive, in said order, written as:

    IF (expression) negative,zero,positive

While it was originally the only kind of IF statement provided in the language, the feature was labeled obsolescent in Fortran 90 after the introduction of the more common logical if statement.

[edit] See also

[edit] Reference