erf、erff、erfl、erfc、erfcf、erfcl
9/1/2020
本文内容
计算某个值的误差函数或补余误差函数。
语法
double erf(
double x
);
float erf(
float x
); // C++ only
long double erf(
long double x
); // C++ only
float erff(
float x
);
long double erfl(
long double x
);
double erfc(
double x
);
float erfc(
float x
); // C++ only
long double erfc(
long double x
); // C++ only
float erfcf(
float x
);
long double erfcl(
long double x
);
#define erf(X) // Requires C11 or higher
#define erfc(X) // Requires C11 or higher
参数
x-blade
浮点值。
返回值
Erf函数返回x的高斯错误函数。 Erfc函数返回x的互补高斯错误函数。
备注
Erf函数计算x的高斯错误函数,该函数定义为:
互补高斯错误函数定义为 1-erf (x) 。 Erf函数返回的值范围为-1.0 到1.0。 无错误返回。 Erfc函数返回0到2范围内的值。 如果 x 对于 erfc太大,则将 errno 变量设置为 ERANGE。
由于 c + + 允许重载,因此你可以调用采用并返回和类型的 erf 和 erfc 的重载 float long double 。 在 C 程序中,除非使用 宏调用此函数,否则, erf 和 erfc 始终采用并返回 double 。
如果使用 erf() 宏,则参数的类型将决定选择哪个版本的函数。 有关详细信息,请参阅 类型-泛型数学 。
默认情况下,此函数的全局状态的作用域限定为应用程序。 若要更改此项,请参阅 CRT 中的全局状态。
要求
函数
必需的标头
erf、 erff、 erfl、 erfc、 erfcf、 erfcl
erf 宏
有关其他兼容性信息,请参阅兼容性。
另请参阅