IBM 1620 Manual page 19

Hide thumbs Also See for 1620:
Table of Contents

Advertisement

Rules for Forming
Expressions
There are five rules that you must follow when you write
FORTRAN
arithmetic state-
ments. The purpose of these rules is to help you write your statement correctly
in
FORTRAN
language.
l. The constants and variables used in a
FORTRAN
expression may be either
in fixed point or floating point mode, but both modes cannot be used in the
same expression. For example:
426
3.
I
R
HRS
(J)
Constant - fixed point mode
Constant - floating point mode
Variable - fixed point mode
Variable - floating point mode
Subscripted variable - floating point mode
In the last example, the subscript
J,
used with the floating point variable
HRS,
is in fixed point mode. The mode of the expression is determined only
by the mode of the quantity. Using a fixed point subscript with a floating
point variable does not violate the rule of mixing modes in an expression.
2. Involution of a quantity does not affect the mode of the quantity. However,
a fixed point quantity may never be given an exponent. The following are
valid.
A**B
A**J
floating point
floating point
3. Whenever two operation symbols follow in succession, they must be sep-
arated by parentheses. The following examples illustrate this rule:
Ma thema tical
FORTRAN
Incorrect
FORTRAN
Expression
Expression
Expression
A
AI (-B)
AI-B
-B
AB or A. B
A*B
AB
AE+Z.
A * * (E + 2.)
A**E+2.
AE+2·B
A * * (E + 2.) *B
A**E+2.*B
Common algebraic rules must also be observed. For example the ambig-
uous mathematical expression
C
A
R
can be written as R * * (A * *C) or as (R * * A) * *C, whichever it is intended
to be.
The mathematical expression
AB
CD
can be correctly written as A*B/(C*D) or as A/C * BID. But the ex-
pression A *B/C*D, although it is a valid
FORTRAN
expression, does not
represent the mathematical expression
AB .
CD
Writing the 1620 FORTRAN Program
19

Advertisement

Table of Contents
loading

Table of Contents