HP Pascal/iX Reference Manual (31502-90022)

9- 29
Example
Input Result
hex(strng) depends on the value of strng
hex('FF') 255
-hex('FF') -255
NOTE If a particular implementation uses 32-bit 2's complement notation,
the following example also works:
hex('FFFFFF01') = -255
octal
Usage
octal
(s)
Argument
s
Any string or PAC expression whose range is implementation
dependent.
Description
The octal function converts a string or PAC expression that is
interpreted as an
octal
value to an integer. Leading and trailing blanks
in the argument are ignored. It is an error if any other character is
not a legal octal digit; for example, 0..7.
Example
Input Result
octal(strng) depends on the value of strng
octal('77') 63
-octal('77') -63
NOTE If your particular implementation uses 32-bit 2's complement
notation, the following example also works:
octal('37777777701') -63
Transfer Functions
Round and trunc are the
transfer functions
found in HP Pascal. These
functions are described on the next two pages.
round
Usage
round
(x)
Argument
x
Any real or longreal expression.