31.12.2013 Views

TOPS-20 PASCAL Language Manual - Bitsavers

TOPS-20 PASCAL Language Manual - Bitsavers

TOPS-20 PASCAL Language Manual - Bitsavers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EXPRESSIONS<br />

The set operators (+, *, -, =, , =) require both operands<br />

to be set values. The TN operator, however, requires a set expression<br />

as its second operand and a scalar expression of the associated base<br />

type as its first operand, for example:<br />

The value of this expression is TRUE, because 2*3 evaluates to 6,<br />

which is a member of the set rl •. 10].<br />

3.1.5 Precedence of Operators<br />

The operators in an expression establish the order in which <strong>PASCAL</strong><br />

evaluates the expression. Table 1-6 lists the order of precedence of<br />

the operators, from highest to lowest.<br />

Table 3-h:<br />

Precedence of Operators<br />

Operators<br />

Precedence<br />

NOT<br />

Highest<br />

**<br />

* I, DIV, MOD, REM, AND<br />

* OR<br />

, =, IN Lowest<br />

<strong>PASCAL</strong> evaluates operators of equal precedence (such as + and -) from<br />

left to right. You must use parentheses for correct evaluation when<br />

you combine relational operators, for example:<br />

A (= X AND B (= Y<br />

Without parentheses, <strong>PASCAL</strong> attempts to evaluate this expression as<br />

A

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!