Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.11 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 log2d32(_Decimal32 x);
_Decimal64 log2d64(_Decimal64 x);
_Decimal128 log2d128(_Decimal128 x);
_Decimal32 log2(_Decimal32 x); /* C++ only */
_Decimal64 log2(_Decimal64 x); /* C++ only */
_Decimal128 log2(_Decimal128 x); /* C++ only */
The log2() functions compute the base-2 logarithm of x.
The log2 functions return log2 x.
A domain error occurs if x is less than zero.
A range error may occur if x is zero.
⁄* CELEBL28
This exaxmple illustrates the log2d32() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
void main(void)
{
_Decimal32 x, y;
x = 85.7DF;
y = log2d32(x);
printf("log2d32( %Hf ) = %Hf\n", x, y);
}