C++ cmath erfc() Function
Example
Return the complementary error function of different numbers:
cout << erfc(0) << "\n";
cout << 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 <cmath> header file.
Tip: See also erf(), the error function.
Syntax
erfc(double x)
The function also works with float and long double values. Then it returns a value of the same type.
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 Math Tutorial.