Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 frexpd32(_Decimal32 x, int *expptr);
_Decimal64 frexpd64(_Decimal64 x, int *expptr);
_Decimal128 frexpd128(_Decimal128 x, int *expptr);
_Decimal32 frexp(_Decimal32 x, int *expptr); /* C++ only */
_Decimal64 frexp(_Decimal64 x, int *expptr); /* C++ only */
_Decimal128 frexp(_Decimal128 x, int *expptr); /* C++ only */
Returns the normalized fraction m. If x is 0, the function returns 0 for both the fraction and exponent. The fraction has the same sign as the argument x. The result of the function cannot have a range error.
⁄* CELEBF81
This example illustrates the frexpd64() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal64 x, m;
int n;
x = 164.5DD;
m = frexpd64(x, &n);
printf("The fraction of %Df is %Df and the exponent is %d\n",
x, m, n);
}