標準/拡張機能 | C/C++ | 依存項目 |
---|---|---|
C/C++ DFP | 両方 | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 scalbnd32(_Decimal32 x, int n);
_Decimal64 scalbnd64(_Decimal64 x, int n);
_Decimal128 scalbnd128(_Decimal128 x, int n);
_Decimal32 scalbn(_Decimal32 x, int n); /* C++ only */
_Decimal64 scalbn(_Decimal64 x, int n); /* C++ only */
_Decimal128 scalbn(_Decimal128 x, int n); /* C++ only */
_Decimal32 scalblnd32(_Decimal32 x, long int n);
_Decimal64 scalblnd64(_Decimal64 x, long int n);
_Decimal128 scalblnd128(_Decimal128 x, long int n);
_Decimal32 scalbln(_Decimal32 x, long int n); /* C++ only */
_Decimal64 scalbln(_Decimal64 x, long int n); /* C++ only */
_Decimal128 scalbln(_Decimal128 x, long int n) /* C++ only */
scalbn() および scalbln() ファミリーの関数は、10 の n 乗を明示的に計算することによって、(x * 10 の n 乗) を効率的に (通常とは異なる方法で) 計算します。
scalbn() および scalbln() ファミリーの関数は、(x * 10 の n 乗) を戻します。
⁄* CELEBS68
This example illustrates the scalbnd128() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal128 x, y;
x = 7.2DL;
y = scalbnd128(x, 6000);
printf("scalbnd128(%DDf, 6000) = %DDe¥n", x, y);
}