TAL Reference Manual

Data Representation
TAL Reference Manual526371-001
3-4
Data Type Aliases
Specifying Widths
When you specify the width of the INT, REAL, or UNSIGNED data type, the constant
expression can include LITERALs and DEFINEs. Here is an example that includes a
LITERAL:
LITERAL int_size = (2 * 4) + 8; !INT_SIZE equals 16
INT(int_size) num; !Data type is INT(16)
Section 6, Simple Variables describes LITERALs and DEFINEs on page 5-1.
Specifying fpoints
For the FIXED data type, you can specify an fpoint, an implied fixed-point setting
specified as an integer in the range –19 through 19.
A positive fpoint specifies the number of decimal places to the right of the decimal
point:
FIXED(3) x := 0.642F; !Stored as 642
A negative fpoint specifies a number of integer places to the left of the decimal point.
To store a FIXED value, a negative fpoint truncates the value leftward from the decimal
point by the specified number of digits. When you access the FIXED value, zeros
replace the truncated digits:
FIXED(-3) y := 642945F; !Stored as 642; accessed
! as 642000
Data Type Aliases
The compiler accepts the following aliases for the listed data types:
For consistency, the remainder of this manual avoids using data type aliases. For
example, although the following declarations are equivalent, the manual uses
FIXED(0):
FIXED(0) var;
INT(64) var;
Data Type Alias
INT INT (16)
REAL REAL (32)
FIXED INT (64)