pTAL Reference Manual (H06.08+)

Data Representation
HP pTAL Reference Manual523746-006
3-4
Data Type Aliases
*(asterisk)
prevents scaling of the initialization values (for an explanation of scaling, see
Scaling of FIXED Operands on page 5-7).
Data Type Aliases
The compiler accepts these data type aliases:
The remainder of this manual avoids using data type aliases.
Operations by Data Type
The data type of a variable determines the operations you can perform on the variable.
Example 3-1. Constant Expressions in Data Type Specifications
LITERAL a = 2,
b = 35;
INT(a + 30) aaa; ! OK: INT(32) is valid
INT(b - 5) bbb; ! ERROR: expression must evaluate to valid
! bit length (16, 32, or 64 for an INT)
REAL (b - 19) ccc; ! ERROR: expression must evaluate to valid
! bit length (32 or 64 for REAL)
REAL (b + 29) ddd; ! OK: REAL(64) is valid
UNSIGNED (a) eee; ! OK: UNSIGNED fields can be any number of
! bits from 1 to 31.
Data Type Aliases
INT INT(16)
REAL REAL(32)
FIXED FIXED(0)
INT(64)
Table 3-3. Operations by Data Type
Operation STRING
INT or
UNSIGNED
(1-16)
INT(32) or
UNSIGNED
(17-31) FIXED
REAL or
REAL(64)
Unsigned arithmetic Yes Yes Yes No No
Signed arithmetic Yes Yes Yes Yes Yes
Logical operations Yes Yes Yes No No
Relational operations Yes Yes Yes Yes Yes
Bit shifts Yes Yes Yes No No
Byte scans Yes Yes Yes Yes Yes