TAL Reference Manual
Standard Functions
TAL Reference Manual—526371-001
14-19
Example of $FIXR Function
Example of $FIXR Function
1. In this example, $FIXR returns a rounded FIXED(0) value from a REAL(64)
expression:
FIXED rfixnum; !Declare variables
REAL(64) bigrealnum := -1.5L0;
rfixnum := $FIXR (bigrealnum); !Return -1F
2. In this example, $FIXR returns a rounded FIXED(0) value from a REAL
expression:
FIXED rndfnum;
REAL realnum := 123.456E0; !Declare variables
rndfnum := $FIXR (realnum); !Return 123F
$FLT Function
The $FLT function returns a REAL value from an INT, INT(32), FIXED(fpoint), or
REAL(64) expression.
expression
is an INT, INT(32), FIXED(fpoint), or REAL(64) expression.
Usage Consideration
If a FIXED expression has a nonzero fpoint, the compiler multiplies or divides the result
by the appropriate power of ten.
Example of $FLT Function
In this example, $FLT returns a REAL value from an INT(32) expression:
REAL realnum; !Declare variables
INT(32) dblnum := 147D;
realnum := $FLT (dblnum); !Return 147E0
$FLT ( expression
)
VST1418.vsd