Arithmetic IF
From Wikipedia, the free encyclopedia
This article is orphaned as few or no other articles link to it. Please help introduce links in articles on related topics. (April 2008) |
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.