*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: cvt_ftof | Section: 3 | Source: Digital UNIX | File: cvt_ftof.3.gz
cvt_ftof(3) Library Functions Manual cvt_ftof(3) NAME cvt_ftof - Converts a floating-point data type to another supported floating-point data type. LIBRARY Math Library (libm.a) SYNOPSIS #include <cvt.h> int cvt_ftof( void *input_val, int input_type, void *output_val, int output_type, int options); DESCRIPTION cvt_ftof() converts one floating-point data type to another. In- put_val points to the input value to be converted and output_val points to the converted result. The conversion is subject to the options specified in the options (bit field) argument. This function returns a bit field indicating any status conditions. Input_type and output_type identify the floating-point data type of in- put_val and output_val as follows: tab(@); lfHB lfHB lfHB l l l . _ Input_type/Output_type@Data Type@Size _ CVT_VAX_F@VAX F Floating@ 4 bytes CVT_VAX_D@VAX D Floating@ 8 bytes CVT_VAX_G@VAX G Floating@ 8 bytes CVT_VAX_H@VAX H Floating@16 bytes CVT_IEEE_S@IEEE Little Endian S Floating@ 4 bytes CVT_IEEE_T@IEEE Lit- tle Endian T Floating@ 8 bytes CVT_IEEE_X@IEEE Little Endian X Float- ing@16 bytes CVT_BIG_ENDIAN_IEEE_S@IEEE Big Endian S Floating@ 4 bytes CVT_BIG_ENDIAN_IEEE_T@IEEE Big Endian T Floating@ 8 bytes CVT_BIG_EN- DIAN_IEEE_X@IEEE Big Endian X Floating@16 bytes CVT_IBM_SHORT@IBM Short Floating@ 4 bytes CVT_IBM_LONG @IBM Long Floating @ 8 bytes CVT_CRAY_SINGLE@Cray Single Floating@ 8 bytes _ Provide a zero (0) value to the options argument to select default be- havior or choose one or more options (status condition option, rounding options, "FORCE" options, Cray and IBM options) from the tables below as the options argument. Specify only the options that apply to your conversion. A conflicting or incompatible options argument will be re- ported as an error (CVT_INVALID_OPTION). tab(@); lfHB lfHB lfHB lfHB lfHB lfHB l l l . _ Applicable@@ Conversion@Status Condition Option@Description _ All@ CVT_REPORT_ALL @T{ Report all applicable status conditions as the default. The reporting of recoverable status conditions is disabled by default when this option is not used. T} _ tab(@); lfHB lfHB lfHB lfHB lfHB lfHB l l l . _ Applicable@@ Conversion@Rounding Options @Description _ All@CVT_ROUND_TO_NEAREST@T{ The default rounding mode for conversions to IEEE data types. This IEEE Std. 754 rounding mode results in a rep- resentable output value nearest to the infinitely precise result. If the two nearest representable values are equally near, the one with its least significant bit zero is the result. T} All@CVT_BIASED_ROUNDING@T{ The default rounding mode for conversions to non-IEEE data types. Performs "traditional" style rounding. This mode results in a representable output value nearest to the infinitely pre- cise 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. T} All@CVT_ROUND_TO_ZERO@T{ Round the output value toward zero (truncate). T} All@CVT_ROUND_TO_POS@T{ Round the output value toward positive infin- ity. T} All@CVT_ROUND_TO_NEG@T{ Round the output value toward negative infin- ity. T} _ tab(@); lfHB lfHB lfHB lfHB lfHB lfHB l l l . _ Applicable@@ Conversion@"FORCE" Options @Description _ All@CVT_FORCE_ALL_SPECIAL_VALUES@T{ Apply all applicable "FORCE" op- tions for the current conversion. T} IEEE @CVT_FORCE_DENORM_TO_ZERO @T{ Force a denormalized IEEE output value to zero. This option is valid only for conversions to IEEE out- put values. T} IEEE @CVT_FORCE_INF_TO_MAX_FLOAT @T{ Force a positive IEEE infinite output value to +max_float and force a negative IEEE infinite output value to -max_float. This option is valid only for conversions to IEEE output values. T} IEEE or VAX @CVT_FORCE_INVALID_TO_ZERO @T{ Force an invalid IEEE NaN (not a number) output value or a VAX ROP (reserved operand) output value to zero. This option is valid only for conversions to IEEE or VAX output values. T} _ tab(@); lfHB lfHB lfHB lfHB lfHB lfHB l l l . _ Applicable@@ Conversion@Options for Cray Format Conversion @Description _ Cray @CVT_ALLOW_OVRFLW_RANGE_VALUES @T{ Allow an input/output exponent value > 60000 (8). T} Cray @CVT_ALLOW_UDRFLW_RANGE_VALUES @T{ Allow an input/output exponent value < 20000 (8). T} _ tab(@); lfHB lfHB lfHB lfHB lfHB lfHB l l l . _ Applicable@@ Conversion@Options for IBM Format Conversion @Description _ IBM @CVT_ALLOW_UNNORMALIZED_VALUES @T{ Allow unnormalized input argu- ments. Allow an unnormalized output value for a small value which would normalize to zero. T} _ The maximum representable floating-point values (max_float) for the IEEE_S_Floating, IEEE_T_Floating, IEEE_X_Floating, Big_En- dian_IEEE_S_Floating, Big_Endian_IEEE_T_Floating, and Big_En- dian_IEEE_X_Floating formats are: tab(@); lfHB lfHB lfHB l l l . _ Data Type@ max_float Value@ _ S_FLOAT @Decimal: 3.402823e38@ T_FLOAT @Decimal: 1.797693134862316e308@ X_FLOAT @Decimal: 1.189731495357231765085759326628007016196477e4932@ _ EXAMPLES This example converts the value pointed to by big_x which is of type IEEE Big Endian T Floating, to the IEEE Little Endian T Floating data type and stores the result in the location pointed to by lit- tle_x. No conversion options are specified. status = cvt_ftof( &big_x, CVT_BIG_ENDIAN_IEEE_T, &little_x, CVT_IEEE_T, 0 ); This example converts the value pointed to by x which is of type VAX D Floating, to the IEEE Little Endian T Floating data type and stores the result in the location pointed to by y. Any special IEEE values which would normally be generated will be removed. That is, NaN and Denormalized results will be returned as zero and infinite re- sults will go to +- max_float. In addition, all recordable status conditions will be reported. status = cvt_ftof(&x, CVT_VAX_D, &y, CVT_IEEE_T, (CVT_FORCE_ALL_SPECIAL_VALUES | CVT_REPORT_ALL) ); RETURN VALUES The return value is a bit field containing the condition codes raised by the function. cvt_ftof() returns CVT_NORMAL; otherwise, it sets one or more of the following recoverable and unrecoverable conditions. Use the following condition names to determine which conditions are set: tab(@); lfHB lfHB l lw(3.0i) . _ Condition Name@Condition (Always reported by default) _ CVT_INVALID_INPUT_TYPE @T{ Invalid input type code. T} CVT_INVALID_OUTPUT_TYPE @T{ Invalid output type code. T} CVT_INVALID_OPTION @T{ Invalid option argument. T} _ tab(@); lfHB lfHB lw(2.0i) lw(2.1i) . _ @Condition (Only reported if the Condition Name@CVT_RE- PORT_ALL option is selected) _ CVT_RESULT_INFINITE @T{ Conversion produced an infinite result. (For conversions to IEEE data types.) T} CVT_RESULT_DENORMALIZED @T{ Conversion produced a denormalized result. (For conversions to IEEE data types.) T} CVT_RESULT_OVERFLOW_RANGE @T{ Conversion yielded an exponent > 60000 (8). (For Cray data type conversions.) T} CVT_RESULT_UNDERFLOW_RANGE @T{ Conversion yielded an exponent < 20000 (8). (For Cray data type conversions.) T} CVT_RESULT_UNNORMALIZED @T{ Conversion produced an unnormalized result. (For IBM data type conversions and reported T} CVT_RESULT_INVALID @T{ Conversion result is either ROP (reserved operand), NaN (not a number), or closest equivalent. Cray and IBM data types return 0. (For all data type conversions.) T} CVT_RESULT_OVERFLOW @T{ Conversion resulted in overflow. (For all data type conversions.) T} CVT_RESULT_UNDERFLOW @T{ Conversion resulted in underflow. (For all data type conversions.) T} CVT_RESULT_INEXACT @T{ Conversion resulted in a loss of precision. (For all data type conversions.) T} _ RELATED INFORMATION ANSII/IEEE Std 754-1985, IEEE Standard for Binary Floating-Point Arith- metic delim off cvt_ftof(3)

Navigation Options