pTAL Conversion Guide

Expressions
pTAL Conversion Guide527302-002
13-5
Using INT(32) Operands With Unsigned Comparison
Operators
Using INT(32) Operands With Unsigned Comparison Operators
In pTAL, you can use INT(32) operands with unsigned comparison operators ('<', '<=',
'=', '<>', '>=', and '>'). The INT(32) operands are treated as nonnegative values in the
range 0 to 2
32
-1.
Using INT(32) Operands With Unsigned Add and Subtraction
Operators
In pTAL, you can use INT(32) operands with unsigned addition and subtraction
operators ('+' and '-'). The INT(32) operands are treated as nonnegative values in the
range 0 to 2
32
-1.
Unsigned and signed addition and subtraction are the same except that $OVERFLOW
is always false after an unsigned operation.
Using INT(32) Operands With the Unsigned Multiplication
Operator
In pTAL, you can use INT(32) operands with the unsigned multiplication operator ('*').
The INT(32) operands are treated as nonnegative values in the range 0 to 2
32
-1.
The unsigned product of two INT(32) values is an FIXED value.
$OVERFLOW is always false after an unsigned multiplication operator.
Using INT(32) Operands With the Unsigned Division and
Remainder Operators
In pTAL, you can use an FIXED dividend and INT(32) divisor with the unsigned-division
and remainder operators ('/' and '\'). The FIXED dividend is treated as a nonnegative
value in the range 0 to 2
64
-1. The INT(32) divisor is treated as a nonnegative value in
the range 0 to 2
32
-1.
The quotient or remainder of an FIXED dividend and an INT(32) divisor is an INT(32)
quotient in the range 0 to 2
32
-1.
$OVERFLOW is false after an unsigned division or remainder operator unless either of
the following is true:
The divisor is 0
The quotient is greater than 2
16
-1 for an INT quotient, 2
32
-1 for an INT(32)
quotient