EasyManuals Logo
Home>IBM>Desktop>1620

IBM 1620 User Manual

IBM 1620
111 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #20 background imageLoading...
Page #20 background image
Verification
of
Correct Use
of
Parentheses
Mode
of
an
Arithmetic
Statement
20
4.
Parentheses
are
used
to specify
the
order
of operations
in
an
expression.
If
parentheses
are
omitted,
the
order
is taken to
be
from left to
right
as
follows:
**
*
and
/
+
and-
involution (raising to a
power)
multiplication
and
division
addition
and
subtraction
For
example the
FORTRAN
expression
A +
B/C
+ D
**E*F-G
will
be
taken
to
mean
the
mathematical expression
A+~+(DE'F)-G
C
The
FORTRAN
expression could
have
been
written
with parentheses as
follows:
A +
(B/C)
+
(D**E*F)
- G
5.
A sequence
of.
consecutive multiplications
and
divisions
(or
consecutive
additions
and
subtractions)
without
parentheses will
be
grouped
from the
left.
For
example:
A*B*C*D*E
will
be
taken to
mean
((
((A*B)*C)*D)*E)
Until you become proficient in writing
FORTRAN
programs, always use
paren-
theses to specify
the
order
of operations.
To
check a complicated
FORTRAN
expression to determine
that
the
parentheses
are
correctly
inserted
in pairs, use
the
following method.
Working from
the
left to right, label
the
first
open
parenthesis "1,"
and
increase
the
label
by
1 for each
open
parenthesis
and
decrease
it
by
1 for each closed paren-
thesis.
The
label of
the
last parenthesis should
be
O.
The
mate
of an
open
paren-
thesis labelled n will
be
the next parenthesis labeled n-l.
r--
--
------
-
--:--
- - -
-------
-----
---,
I I
I
r----------------------
____ , I
I I I I
I I I
1 :
i--,-------~~---~-----l
i
Tt.,
~
t t t
{(
({A*8)*C)*D)*E)
1234
3 2 1 0
The
difference
between
a
FORTRAN
expression
and
a
FORTRAN
arithmetic
statement
should
be
emphasized
at
this time. By definition, an arithmetic statement is com-
posed of a single variable on the left
and
an
arithmetic expression on
the
right. This
distinction is
important
because, although an expression
must
not
be
in
mixed
mode
(containing
both
fixed
point
and
floating
point
quantities),
an
arithmetic
statement
may
be
in
mixed mode.
For
example,
when
you
write
A =
(I*J)/K
(
1*
J )
/K
is
an
expression
and
A =
(I
* J )
/K
is
an
arithmetic statement.

Other manuals for IBM 1620

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM 1620 and is the answer not in the manual?

IBM 1620 Specifications

General IconGeneral
BrandIBM
Model1620
CategoryDesktop
LanguageEnglish

Related product manuals