This is a description of the arithmetic if
from FORTRAN 77. Adapted from the FORTRAN 77 specification (focus):
The form of the arithmetic operator if
:
IF (e) s1 , s2 , s2
where: e
is an integer, real or double exact expression
s1
, s2
and s3
are the operator tag of the executable operator, which appears in the same program module as the if
arithmetic operator. The same operator label may appear more than once in the same if
arithmetic expression.
Performing an arithmetic if
causes an evaluation of the expression e
, followed by a transfer of control. The operation indicated by s1
, s2
or s3
is performed as follows, since the value of e
less than zero, equal to zero or greater than zero, respectively.
For example, in your question, from the previous sentence above,
- If instruction
J1-3 < 0
is executed - If instruction
J1-3 = 0
20 will also be executed - If the statement
J1-3 > 0
21 is executed
Change A modern and much more convenient way to record:
if (J1-3 > 0) J1 = J1 - 3 if (J2-3 > 0) J2 = J2 - 3
Chris source share