TAL Reference Manual
Expressions
TAL Reference Manual—526371-001
4-10
Unsigned Arithmetic Operators
Table 4-6 shows the combinations of operand types you can use with binary unsigned
arithmetic operators and the result types yielded by such operators. The order of the
operand types in each combination is interchangeable except in the last case.
‘/’
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.
Table 4-6. Unsigned Arithmetic Operand and Result Types
Operator
Operand
Type Operand Type
Result
Type Example
'+'
'-'
STRING STRING INT byte1 '–' byte2
INT INT INT word1 '+' word2
INT STRING INT byte1 '–' word1
INT UNSIGNED (1–16) INT word1 '+' uns8
STRING UNSIGNED (1–16) INT byte1 '–' uns5
UNSIGNED
(1–16)
UNSIGNED(1–16) INT uns1 '+' uns7
'*'
STRING STRING INT (32) byte1 '*' byte2
INT INT INT (32) wrd1 '*' wrd2
STRING INT INT (32) byte1 '*' wrd1
INT UNSIGNED (1–16) INT (32) wrd1 '*' uns9
STRING UNSIGNED (1–16) INT (32) uns1 '*' uns7
UNSIGNED
(1–16)
UNSIGNED(1–16) INT (32)
uns1 '*' uns7
'/'
'\'
UNSIGNED
(17–31)
STRING, INT, or INT (32)
dbwd '\' word1
or INT(32)
dividend
UNSIGNED(1–16)
divisor
INT
Table 4-5. Unsigned Arithmetic Operators (page2of2)
Operator Operation Operand Type Example