__fp_cast() — cast between floating-point data types

Standards

Standards / Extensions C or C++ Dependencies
  Both OS/390® V2R6

Syntax

#include <_Ieee754.h>
int __fp_cast(int mode, void *src_ptr, int src_type,
                        void *trg_ptr, int trg_type);

General description

The __fp_cast() function casts between C floating-point data types, when the data format does not match the format specified by the FLOAT compiler option. The mode parameter indicates the format of source and target floating-point values pointed to by src_ptr and trg_ptr. Valid values for the mode parameter are _FP_HFP_MODE for hexadecimal floating-point format and _FP_BFP_MODE for IEEE floating-point format.

src_type and trg_type indicate the C data type (float, double, or long double) of the source and target floating-point values, respectively. Valid values for src_type and trg_type are _FP_FLOAT, _FP_DOUBLE or _FP_LONG_DOUBLE.

Return values

If invalid values for mode, src_type or trg_type are specified, __fp_cast() returns -1. Otherwise, it performs the requested cast and returns 0.