pTAL Reference Manual (H06.03+)

Data Representation
HP pTAL Reference Manual523746-005
3-3
Specifying Data Types
Specifying Data Types
The syntax for specifying the data type in a variable declaration is:
width
is a constant expression that specifies the width, in bits, of the variable. The value
of width must be appropriate for the data type (see Example 3-1 on page 3-4):
fpoint
is the implied fixed-point (decimal-point) setting. fpoint is an integer in the range
-19 through 19. The default fpoint is 0 (no decimal places).
A positive fpoint specifies the number of places to the right of the decimal point:
FIXED(3) x := 0.642F; ! Stored as 642
A negative fpoint specifies a number of places to the left of the decimal point.
When the value is stored, it is truncated leftward from the decimal point by the
specified number of digits. When the value is accessed, zeros replace the
truncated digits:
FIXED(-3) y := 642945F; ! Stored as 642; accessed as 642000
Data Type Value of width
INT (16)* 16
INT (32) 32
INT (64)* 64
REAL(32)* 32
REAL(64) 64
UNSIGNED(n ) In the range 1 through 31
* Data type alias (see Data Type Aliases on page 3-4)
STRING
INT
REAL
UNSIGNED
FIXED
(
width
(
width )
)
( )fpoint
*
VST214.vsd