pTAL Conversion Guide

Expressions
pTAL Conversion Guide527302-002
13-4
Using Unsigned Operators and INT(32) Operands
Using Unsigned Operators and INT(32)
Operands
In pTAL, you can use INT(32) operands with some operators with which you can use
only INT operands in TAL.
Topics:
Using INT(32) Operands With Logical Operators on page 13-4
Using INT(32) Operands With Unsigned Comparison Operators on page 13-5
Using INT(32) Operands With Unsigned Add and Subtraction Operators on
page 13-5
Using INT(32) Operands With the Unsigned Multiplication Operator on page 13-5
Using INT(32) Operands With the Unsigned Division and Remainder Operators on
page 13-5
Using INT(32) Operands With Logical Operators
TAL
You cannot use INT(32) operands with the LOR, LAND, or XOR logical operators.
pTAL
You can use INT(32) operands with the LOR, LAND, and XOR logical operators, as in
the following example, which swaps the values stored in i and j:
INT(32) i;
INT(32) j;
i := i XOR j;
j := i XOR j;
i := i XOR j;
Example 13-4. Using Result of 16-bit Operator After an Overflow
INT i;
i := 32767; ! Largest positive signed 16-bit value
i := i + 1; ! Value of i is now undefined
IF i = %H8000 THEN ... ! Conditional expression is TRUE
! in TNS processes,
! undefined in native processes