標準/拡張機能 | C/C++ | 依存項目 |
---|---|---|
C/C++ DFP | 両方 | 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 */
log2() 関数は、x の底 2 の対数を計算します。
log2 関数は、log2 x を戻します。
x がゼロより小さい場合、ドメイン・エラーが発生します。
x がゼロの場合、範囲エラーが発生します。
⁄* 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);
}