Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
int ilogbd32(_Decimal32 x);
int ilogbd64(_Decimal64 x);
int ilogbd128(_Decimal128 x);
int ilogb(_Decimal32 x); /* C++ only */
int ilogb(_Decimal64 x); /* C++ only */
int ilogb(_Decimal128 x); /* C++ only */
If successful, these functions return the unbiased exponent of x as an integer.
If x is equal to 0.0, ilogb() will return _FP_DEC_ILOGB0 (= -INT_MAX).
If x is a NaN or infinity, ilogb() will return INT_MAX.
⁄* CELEBI11
This example illustrates the ilogbd128() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal128 x = -12345.678901DL;
int y;
y = ilogbd128(x);
printf("The result of ilogbd128(%DDf) is %d\n", x, y);
}