pTAL Reference Manual (H06.03+)

Expressions
HP pTAL Reference Manual523746-005
5-9
Unsigned Arithmetic Operators
In Table 5-7 on page 5-9, the order of the operand types in each combination is
interchangeable except in the last case.
Topics:
Bitwise Logical Operators on page 5-10
Using Bitwise Logical Operators and INT(32) Operands on page 5-10
'/' Unsigned division INT(32) or UNSIGNED
(17-31) dividend and
STRING, INT, or
UNSIGNED(1-16) divisor
alpha '/' beta
'\' Unsigned remainder* INT(32) or UNSIGNED
(17-31) dividend and
STRING, INT, or
UNSIGNED(1-16) divisor
alpha '\' beta
* If the quotient exceeds 16 bits, an overflow condition occurs and the results will have unpredictable values. For
example, the operation 200000D '\' 2 causes an overflow because the quotient exceeds 16 bits.
Table 5-7. 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)
or INT(32) dividend
STRING, INT, or
UNSIGNED(1-16)
divisor
INT dbwd '\' word1
Table 5-6. Unsigned Arithmetic Operators (page2of2)
Operator Operation Operand Type Example