Home C&C++函数库 c++ 语法 程序源码 Linux C库

erfc

函数  <cmath> <ctgmath>

C99 double erfc (double x);
float erfcf (float x);
long double erfcl (long double x);
C++11 double erfc (double x);
float erfc (float x);
long double erfc (long double x);
double erfc (T x);     // additional overloads for integral types

互补误差函数
自变量为x的互补误差函数
互补误差函数等价于:

erfc(x) = 1-erf(x)

C99 头文件<tgmath.h> 提供了该函数的泛型类型宏版本。
C++11 这个头文件(<cmath>)为整型提供了额外的重载:这些重载在计算之前将x转换为double (在T是任何整型时定义)。
erfc.png

☲  参数


x
互补误差函数的自变量

☉  返回值



自变量为x的互补误差函数 如果x太大,则会出现下溢范围错误。 如果发生下溢范围错误: -并且math_errhandling设置了MATH_ERRNO:全局变量errno设置为ERANGE。 -并且math_errhandling设置了MATH_ERREXCEPT:触发FE_UNDERFLOW

☣  示例



/* erfc example */
#include <stdio.h>      /* printf */
#include <math.h>       /* erfc */

int main ()
{
  double param, result;
  param = 1.0;
  result = erfc (param);
  printf ("erfc(%f) = %f\n", param, result );
  return 0;
}

输出:
erfc (1.000000) = 0.157299

🍄  另请参阅



erf 误差函数(function )
tgamma 伽马函数 (function )
lgamma log-gamma函数 (function )


联系我们 免责声明 关于CandCplus 网站地图