当前位置: C语言 -- 标准库 -- <math.h> -- erfc

erfc函数


概要:
#include <math.h>
double erfc(double x);

描述:

该函数计算参数x的互补误差函数。如果正值x太大,会出现范围错误。


参数:
double x

参数为一个double类型的浮点数。


返回值:

函数返回erfc x=1-erf x=2π xe-t2dt


范例:
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
/*函数erfc范例*/

#include <math.h>
#include <stdio.h>

int main(void)
{
    double x = 2.0;
    double y;

    y = erfc(x);
    printf("The complementary error function of %.6f is %.6f.\n", x, y);

    return 0;
}

输出:

The complementary error function of 2.000000 is 0.004678.


相关内容:
erfcf float类型的互补误差函数。
erfcl long double类型的互补误差函数。