HPFPCONVERT [ MPE/iX Intrinsics Reference Manual ] MPE/iX 5.0 Documentation
MPE/iX Intrinsics Reference Manual
HPFPCONVERT
NM and CM callable.
Converts data between binary floating-point formats.
Syntax
______________________________________________________
| |
| * * I16V I16V |
| HPFPCONVERT(source,destination,sformat,dformat,|
| I32 I16 I16V |
| status,exceptions,roundmode) |
______________________________________________________
Parameters
source any supported real type by reference (required)
Passes the floating-point number to be converted.
Constants are not acceptable. You can specify a
reference parameter of any supported real type in
the intrinsic call statement. The format is
identified by sformat.
destination any supported real type by reference (required)
Returns the converted floating-point number. If
status.info is less than zero, the number is not
converted. Any supported real type can be returned
to the intrinsic call statement. The format is
identified by dformat.
sformat 16-bit signed integer by value (required)
The floating-point format of the binary number
supplied by source. This is the format of the
original number. Valid formats are:
Value Meaning
1 Hewlett-Packard 3000 32-bit
2 Hewlett-Packard 3000 64-bit
3 IEEE 32-bit
4 IEEE 64-bit
5 IEEE 128-bit
dformat 16-bit signed integer by value (required)
The destination floating-point format. This is the
looking forward to some leisure and alternative
nursing choices.format of the converted number.
Valid formats are:
Value Meaning
1 Hewlett-Packard 3000 32-bit
2 Hewlett-Packard 3000 64-bit
3 IEEE 32-bit
4 IEEE 64-bit
5 IEEE 128-bit
status 32-bit signed integer by reference (optional)
Returns the status of the HPFPCONVERT intrinsic
call. If no errors or warnings are encountered,
status returns 32 bits of zero. If errors or
warnings are encountered, status is interpreted as
two 16-bit fields.
Bits (0:16) comprise status.info. A negative value
indicates an error condition, refer to the MPE/iX
Error Message Manual Volumes 1, 2 and 3
(32650-90066, 32650-90152, and 32650-90368) for a
description of its value. A positive value
indicates that the conversion was made, but an
exception occurred and an exceptions parameter was
not supplied. The exception conditions are listed
in the exceptions parameter description.
Bits (16:16) comprise status.subsys. The value
represented by these bits defines the subsystem
that set the status information. The subsystem
identifier for HPFPCONVERT is 193.
exceptions 16-bit signed integer by reference (optional)
Returns any exception conditions that occurred
during the conversion. If status.info is less than
zero, then exceptions is not modified because no
conversion is done. If this parameter is not
present, the value is returned in status.info.
Only the following values can be returned:
Value Meaning
0 No exceptions
1 Inexact only (native mode destination only)
3 Underflow and inexact
5 Overflow and inexact
8 Invalid operation
If underflow or overflow occurs during conversion
then inexact is also signaled.
roundmode 16-bit unsigned integer by value (optional)
The rounding mode (not applicable if destination is
an Hewlett-Packard 3000 format).
Value Meaning
0 Round to nearest, to even if tie (default)
1 Round to zero
2 Round to positive infinity
3 Round to negative infinity
Operation Notes
The HPFPCONVERT intrinsic accepts a source binary floating-point number
and converts it to the equivalent destination binary floating-point
format. You must specify the format of the source and destination
numbers. Optionally, you can specify the rounding mode.
The conversion is performed by regarding the source number as infinitely
precise and with unbounded range, and then rounding it to fit the
designated destination format. Rounding is performed according to the
formal rules for the rounding mode specified. Rounding methods and
exception signaling are determined solely from the destination format and
are independent of the source format.
Conversion is performed as if all arithmetic traps are disabled. No
trapping to user-supplied or system-supplied arithmetic trap routines is
done.
Related Information
Intrinsics None
Commands None
Manuals Data Types Conversion Programmer's Guide
(32650-90015).
MPE/iX 5.0 Documentation