C Math erfc() Function
Example
Return the complementary error function of different numbers:
printf("%f\n", erfc(0));
printf("%f", erfc(1));
Definition and Usage
The erfc() function returns the value of the complementary error function at x. This is the same as 1 - erf(x). The result is always between 0 and 2.
When x is big, erfc(x) is more precise than 1 - erf(x).
The erfc() function is defined in the <math.h> header file.
Tip: See also erf(), the error function.
Syntax
double erfc(double x);
There are also versions for float and long double values: erfcf() and erfcl().
Parameter Values
| Parameter | Description |
|---|---|
| x | Required. A number. |
Technical Details
| Returns: | A double value between 0 and 2. |
|---|
Related Pages
Read more about math in our C Math Tutorial.