HP Pascal/iX Reference Manual (31502-90022)

4-: 6
Table 4-2. HP Pascal Operators (cont.)
---------------------------------------------------------------------------------------------
| | | | |
| Operator | Actions | Type of Operands | Type of Results |
| | | | |
---------------------------------------------------------------------------------------------
| | | | |
| <= | less than or | any simple type | Boolean |
| | equal, | string or PAC | Boolean |
| | set subset | any set type | Boolean |
| | | | |
---------------------------------------------------------------------------------------------
| | | | |
| >= | greater than or | any simple type | Boolean |
| | equal, | string or PAC | Boolean |
| | set superset | any set type | Boolean |
| | | | |
---------------------------------------------------------------------------------------------
| | | | |
| = | equal to | any simple type | Boolean |
| | | string or PAC | Boolean |
| | | any set type | Boolean |
| | | pointer | Boolean |
| | | | |
---------------------------------------------------------------------------------------------
| | | | |
| <> | not equal to | any simple type | Boolean |
| | | string or PAC | Boolean |
| | | any set type | Boolean |
| | | pointer | Boolean |
| | | | |
---------------------------------------------------------------------------------------------
| | | | |
| IN | set membership | left operand: | Boolean |
| | | any ordinal type T | |
| | | right operand: | |
| | | set of T | |
| | | | |
---------------------------------------------------------------------------------------------
Operator Precedence
The
precedence
ranking of an HP Pascal operator determines the order of
its evaluation in an unparenthesized sequence of operators. The four
levels of ranking are:
PRECEDENCE OPERATORS
highest NOT
. *, /, DIV, MOD, AND
. +, -, OR
lowest <, <=, <>, =, >=, >, IN
The compiler evaluates higher precedence operators first. For example,
since * ranks above +, it evaluates these expressions identically:
(x + y * z) and (x + (y * z))
When a sequence of operators has equal precedence, the order of
evaluation is implementation dependent. If an operator is commutative,
for example, *, the compiler may evaluate the operands in any order.
Note that within a parenthesized expression the compiler evaluates the
operators and operands without regard for any operators outside the
parentheses.
Arithmetic Operators
Arithmetic
operators perform
integer
and
real
arithmetic by taking
numeric
operands
and producing a
numeric result
. These operators are +,
-, *, /, DIV, and MOD.
Most arithmetic operators permit
real
,
longreal
, or
integral-type
operands. However, DIV and MOD only accept integral-type operands. The
type of the result of a unary operator is the same as the type of its
operand. However, if the operand is bit16, the result is an integer