 |
OpenVMS RTL Library (LIB$) Manual
Declarations for the input_type_code argument are in
the $CVTDEF module found in the system symbol libraries.
output_value
OpenVMS usage: |
varying_arg |
type: |
unspecified |
access: |
write only |
mechanism: |
by reference |
The address of a data area that receives the converted floating-point
number. The number can be floating-point data in F_Floating,
D_Floating, G_Floating, H_Floating, IEEE_S_Floating, IEEE_T_Floating,
IEEE_X_Floating, Big_Endian_IEEE_S_Floating,
Big_Endian_IEEE_T_Floating, Big_Endian_IEEE_X_Floating,
IBM_Long_Floating, IBM_Short_Floating, or CRAY_Floating_Single format.
The value of the output_type_code argument determines
the size and format of the converted floating-point number.
output_type_code
OpenVMS usage: |
longword_unsigned |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
The value of a longword bit mask specifying the type of floating-point
data that the input_value argument will be converted
into and returned in the output_value argument. Valid
type codes are:
Output_type_code |
Format |
Size in Bytes |
CVT$K_VAX_F
|
F_Floating
|
4
|
CVT$K_VAX_D
|
D_Floating
|
8
|
CVT$K_VAX_G
|
G_Floating
|
8
|
CVT$K_VAX_H
|
H_Floating
|
16
|
CVT$K_IEEE_S
|
IEEE_S_Floating
|
4
|
CVT$K_IEEE_T
|
IEEE_T_Floating
|
8
|
CVT$K_IEEE_X
|
IEEE_X_Floating
|
16
|
CVT$K_BIG_ENDIAN_IEEE_S
|
Big_Endian_IEEE_S_Floating
|
4
|
CVT$K_BIG_ENDIAN_IEEE_T
|
Big_Endian_IEEE_T_Floating
|
8
|
CVT$K_BIG_ENDIAN_IEEE_X
|
Big_Endian_IEEE_X_Floating
|
16
|
CVT$K_IBM_LONG
|
IBM_Long_Floating
|
8
|
CVT$K_IBM_SHORT
|
IBM_Short_Floating
|
4
|
CVT$K_CRAY_SINGLE
|
CRAY_Floating
|
8
|
Declarations for the output_type_code argument are in
the $CVTDEF module found in the system symbol libraries.
options
OpenVMS usage: |
mask_longword |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Conversion option specifier. The options argument is
the address of a longword bit mask in which each option bit set causes
the corresponding option to be used during the conversion. Provide a
zero (0) value to the options argument to select
default behavior or choose one or more options (status condition
option, rounding options, "FORCE" options, CRAY and IBM options) from
the following tables. Specify only the options that apply to your
conversion. A conflicting or incompatible options
argument is reported as an error (CVT$M_INVALID_OPTION).
Applicable Conversion |
Option |
Description |
|
Status Condition Option |
All
|
CVT$M_REPORT_ALL
|
Report all applicable status conditions as the default. The reporting
of recoverable status conditions is disabled by default when this
option is not used.
|
|
Rounding Options |
All
|
CVT$M_ROUND_TO_NEAREST
|
The default rounding option for conversions to IEEE data types. This
IEEE Std. 754 rounding mode results in the representable output value
nearest to the infinitely precise result. If the two nearest
representable values are equally near, the one whose least significant
bit is 0 is the result.
|
All
|
CVT$M_BIASED_ROUNDING
|
The default rounding option for conversions to non-IEEE data types.
Performs "traditional" style rounding. This mode results in the
representable output value nearest to the infinitely precise result. If
the two nearest representable values are equally near, the output value
is the closest to either positive infinity or negative infinity
depending on the sign of the input value.
|
All
|
CVT$M_ROUND_TO_ZERO
|
Round the output value toward zero (truncate).
|
All
|
CVT$M_ROUND_TO_POS
|
Round the output value toward positive infinity.
|
All
|
CVT$M_ROUND_TO_NEG
|
Round the output value toward negative infinity.
|
|
"FORCE" Options |
All
|
CVT$M_FORCE_ALL_SPECIAL_VALUES
|
Apply all applicable "FORCE" options for the current conversion.
|
IEEE
|
CVT$M_FORCE_DENORM_TO_ZERO
1
|
Force a denormalized IEEE output value to zero.
|
IEEE
|
CVT$M_FORCE_INF_TO_MAX_FLOAT
1
|
Force a positive IEEE infinite output value to +max_float and force a
negative IEEE infinite output value to --max_float.
|
IEEE or VAX
|
CVT$M_FORCE_INVALID_TO_ZERO
2
|
Force an invalid IEEE NaN (not a number) output value or a VAX ROP
(reserved operand) output value to zero.
|
|
CRAY Format Conversion Options |
CRAY
|
CVT$M_ALLOW_OVRFLW_RANGE_VALUES
|
Allow an input/output exponent value > 60000 (8).
|
CRAY
|
CVT$M_ALLOW_UDRFLW_RANGE_VALUES
|
Allow an input/output exponent value < 20000 (8).
|
IBM Format Conversion Option |
IBM
|
CVT$M_ALLOW_UNNORMALIZED_VALUES
|
Allow unnormalized input arguments. Allow an unnormalized output value
for a small value that would normalize to zero.
|
1This option is valid only for conversions to IEEE output
values.
2This option is valid only for conversions to IEEE or VAX
output values.
The maximum representable floating-point values (max_float) for the
IEEE_S_Floating, IEEE_T_Floating, IEEE_X_Floating,
Big_Endian_IEEE_S_Floating, Big_Endian_IEEE_T_Floating, and
Big_Endian_IEEE_X_Floating formats are:
Data Type |
Value for: max_float |
S
|
Decimal: 3.402823e38
|
T
|
Decimal: 1.797693134862316e308
|
X
|
Decimal: 1.189731495357231765085759326628007016196477e4932
|
Declarations for the options argument are in the $CVTDEF module found
in the system symbol libraries.
Description
CVT$FTOF functionality is available on all Compaq platforms and is the
floating-point conversion routine of choice for portability. When
compared with the standard CVT$CONVERT_FLOAT routine, CVT$FTOF includes
additional functionality and increased performance.
CVT$FTOF is a general-purpose floating-point conversion routine that
converts any input_type_code floating-point data type
into any output_type_code floating-point data type.
The conversion is subject to the options specified in the
options argument.
Note
OpenVMS compilers do not support arithmetic operations for all of the
floating-point data types described here. Additional floating-point
data types are supported by this routine for data conversion purposes
only.
|
|