IBM 5100 Basic Reference Manual page 57

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

(
(
(
(-
Arithmetic Hierarchy
Arithmetic expressions are evaluated according to the hierarchy of the operators
involved. Operations enclosed in parentheses are performed first. Operations with
a higher priority level are performed before those with a lower priority level. Oper-
ations at the same priority level are performed from left to right. The hierarchy of
the operators are:
Operator
Hierarchy
1.
Enclosed in parentheses
Highest
2.
tor
**
3.
Positive
+
and Negative -
4.
*
and /
5.
Addition
+
and Subtraction -
Lowest
An expression is evaluated by being reduced to its component subexpressions. A
subexpression is defined as a group that can be read
operand-opera tor-operand,
where
an operand is one of the following:
• A simple reference to data (constant or variable)
• A subscripted array reference
• A function reference
• A parenthesized subexpression
Starting with the first operator to be executed according to the hierarchy, the operands
of its subexpression are reduced to simple references to data in aleft-to-right order.
This process is repeated as many times as required in a left-to-right order or in a
decreasing order of priority, or both, of the remaining operators until the entire
expression is reduced to a simple reference to the evaluated result.
53

Advertisement

Table of Contents
loading

Table of Contents