TAL Programmer's Guide

Arithmetic Expressions
Using Expressions
5–18 096254 Tandem Computers Incorporated
The following example shows how the system makes automatic adjustments when
operands in an expression have different fpoints:
The fpoint of C is increased by 3
FIXED a;
FIXED(2) b;
FIXED (-1) c;
a := 2.015F * (b + c);
415
Data declarations
The final result is truncated by
5 places to match the fpoint of A
up 3
0
5
23
Effect on Hardware Indicators
Signed arithmetic operators affect the hardware indicators, as described in “Testing
Hardware Indicators” later in this section.
Unsigned Arithmetic
Operators
You can use binary unsigned arithmetic on operands with values in the range 0
through 65,535. For example, you can use unsigned arithmetic with pointers that
contain standard addresses. Table 5-12 lists unsigned arithmetic operators and the
operand types on which they can operate.
Table 5-12. Unsigned Arithmetic Operators
Operator Operation Operand Type Example
'+' Unsigned addition STRING, INT, or UNSIGNED(1–16) alpha '+' beta
'–' Unsigned subtraction STRING, INT, or UNSIGNED(1–16) alpha '–' beta
'*' Unsigned multiplication STRING, INT, or UNSIGNED(1–16) alpha '
*
' beta
'/' Unsigned division INT(32) or UNSIGNED (17–31)
dividend and STRING, INT, or
UNSIGNED(1–16) divisor
alpha '/' beta
'\' Unsigned modulo division
*
INT(32) or UNSIGNED (17–31)
dividend and STRING, INT, or
UNSIGNED(1–16) divisor
alpha '\' beta
*
Unsigned modulo operations return the remainder. If the quotient exceeds 16 bits, an overflow
condition occurs and the results will have unpredictable values. For example, the modulo
operation 200000D '\' 2 causes an overflow because the quotient exceeds 16 bits.