標準/拡張機能 | C/C++ | 依存項目 |
---|---|---|
C/C++ DFP |
両方 | z/OS® V1.10 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 erfd32(_Decimal32 x);
_Decimal64 erfd64(_Decimal64 x);
_Decimal128 erfd128(_Decimal128 x);
_Decimal32 erf(_Decimal32 x); /* C++ only */
_Decimal64 erf(_Decimal64 x); /* C++ only */
_Decimal128 erf(_Decimal128 x); /* C++ only */
_Decimal32 erfcd32(_Decimal32 x);
_Decimal64 erfcd64(_Decimal64 x);
_Decimal128 erfcd128(_Decimal128 x);
_Decimal32 erfc(_Decimal32 x); /* C++ only */
_Decimal64 erfc(_Decimal64 x); /* C++ only */
_Decimal128 erfc(_Decimal128 x); /* C++ only */
erfc() 関数は 1.0 - erf(x) の値を計算するので、 大きな値の x の場合に erf() の代わりに使用されます。
これらの関数は、IEEE 10 進数浮動小数点形式で機能します。詳細は、IEEE 10 進数浮動小数点を参照してください。
erf() と erfc() は、常に正常に実行されます。
CELEBE12
⁄* CELEBE12
This example illustrates the erfd32() and erfcd32() functions.
*⁄
#define __STDC_WANT_DEC_FP__
#include <stdio.h>
#include <math.h>
_Decimal32 smallx, largex, value;
int main(void)
{
smallx = 0.1DF;
largex = 10.0DF;
value = erfd32(smallx);
printf("Error value for 0.1: %Hf¥n", value);
value = erfcd32(largex);
printf("Error value for 10.0: %He¥n", value);
}