pTAL Reference Manual (H06.03+)

Built-In Routines
HP pTAL Reference Manual523746-005
15-48
$FIXL
$FIXL
$FIXL converts a FIXED value to an unsigned INT value.
fixed-expression
is a FIXED expression, which $FIXL treats as a FIXED expression, ignoring any
implied decimal point.
If the result cannot be represented in an unsigned 16-bit integer, $FIXL traps if
overflow traps are enabled (see Section 13, Hardware Indicators); otherwise, $FIXL
ignores the problem.
$FIXR
$FIXR converts its argument to a FIXED value and rounds the result.
Example 15-36. $FIXI Routine
INT intnum;
FIXED fixnum := %177777F;
intnum := $FIXI (fixnum); ! Return -1
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW Yes
Example 15-37. $FIXL Routine
INT intnum;
FIXED fixnum := 32767F;
intnum := $FIXL (fixnum); ! Return 32,767
( )
VST087.vsd
$FIXL fixed-expression
expression( )
VST088.vsd
$FIXR