The Full Wiki

More info on Arithmetic IF

Arithmetic IF: Wikis


Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.


From Wikipedia, the free encyclopedia

The arithmetic IF statement has been for several decades a three-way arithmetic conditional statement, starting from the very early version (1957) of Fortran, and including FORTRAN IV, FORTRAN 66 and FORTRAN 77. Unlike the logical IF statements seen in other languages, the Fortran 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 Fortran, the feature was used less and less frequently after the more powerful logical IF statements were introduced, and was finally labeled obsolescent in Fortran 90.

See also



Got something to say? Make a comment.
Your name
Your email address