pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Unsigned Arithmetic Operators
Typically, you 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 28 Unsigned Arithmetic Operators
ExampleOperand TypeOperationOperator
alpha '+' betaSTRING, INT, or
UNSIGNED(1-16)
Unsigned addition'+'
alpha '-' betaSTRING, INT, or
UNSIGNED(1-16)
Unsigned subtraction'-'
alpha '*' betaSTRING, INT, or
UNSIGNED(1-16)
Unsigned multiplication'*'
alpha '/' betaINT(32) or UNSIGNED (17-31)
dividend and STRING, INT, or
UNSIGNED(1-16) divisor
Unsigned division'/'
alpha '\' betaINT(32) or UNSIGNED (17-31)
dividend and STRING, INT, or
UNSIGNED(1-16) divisor
Unsigned remainder*'\'
* 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.
In Table 29 (page 75), the order of the operand types in each combination is interchangeable
except in the last case.
Table 29 Unsigned Arithmetic Operand and Result Types
ExampleResult TypeOperand TypeOperand TypeOperator
byte1 '-' byte2INTSTRINGSTRING'+''-'
word1 '+' word2INTINTINT
byte1 '-' word1INTSTRINGINT
word1 '+' uns8INTUNSIGNED (1-16)INT
byte1 '-' uns5INTUNSIGNED (1-16)STRING
uns1 '+' uns7INTUNSIGNED(1-16)UNSIGNED(1-16)
byte1 '*' byte2INT(32)STRINGSTRING'*'
wrd1 '*' wrd2INT(32)INTINT
byte1 '*' wrd1INT(32)INTSTRING
wrd1 '*' uns9INT(32)UNSIGNED (1-16)INT
uns1 '*' uns7INT(32)UNSIGNED (1-16)STRING
uns1 '*' uns7INT(32)UNSIGNED(1-16)UNSIGNED(1-16)
dbwd '\' word1INTSTRING, INT, or
UNSIGNED(1-16)
divisor
UNSIGNED(17-31) or
INT(32) dividend
'/' '\'
Topics:
• Bitwise Logical Operators (page 76)
• Using Bitwise Logical Operators and INT(32) Operands (page 76)
Unsigned Arithmetic Operators 75