All Topics  
Arithmetic IF

 

   Email Print
   Bookmark   Link






 

Arithmetic IF



 
 
The arithmetic IF statement has been for several decades a three-way arithmetic conditional statement, starting from the very early version (1957) of Fortran
Fortran

Fortran is a general-purpose programming language, procedural programming language, imperative programming language programming language that is especially suited to numerical analysis and scientific computing....
, and including FORTRAN IV, FORTRAN 66 and FORTRAN 77. 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 became more and more unused after the introduction of the more powerful and common logical IF statement, so that it was finally labeled obsolescent
Obsolescence

Obsolescence is the state of being which occurs when a person, object, or service is no longer wanted even though it may still be in good working order....
 in Fortran 90 .








Discussion
Ask a question about 'Arithmetic IF'
Start a new discussion about 'Arithmetic IF'
Answer questions from other users
Full Discussion Forum



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
Fortran

Fortran is a general-purpose programming language, procedural programming language, imperative programming language programming language that is especially suited to numerical analysis and scientific computing....
, and including FORTRAN IV, FORTRAN 66 and FORTRAN 77. 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 became more and more unused after the introduction of the more powerful and common logical IF statement, so that it was finally labeled obsolescent
Obsolescence

Obsolescence is the state of being which occurs when a person, object, or service is no longer wanted even though it may still be in good working order....
 in Fortran 90 .

See also

  • Sign function
    Sign function

    In mathematics, the sign function is an Even and odd functions function that extracts the negative and non-negative numbers of a real number....
  • Three-way comparison
    Three-way comparison

    In computer science, a three-way comparison takes two values A and B belonging to a type with a total order and determines whether A B in a single operation, in accordance with the mathematical trichotomy ....
  • Conditional (programming)


Reference