Export (0) Print
Expand All
and
div
eof
not
or
xor
Expand Minimize
This topic has not yet been rated - Rate this topic

erf, erff, erfl, erfc, erfcf, erfcl

Visual Studio 2013

Computes the error function or the complementary error function of a value.

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
);
x

A floating-point value.

The erf functions return the Gauss error function of x. The erfc functions return the complementary Gauss error function of x.

The erf functions calculate the Gauss error function of x, which is defined as:

The error function of x

The complementary Gauss error function is defined as 1 – erf(x). The erf functions return a value in the range -1.0 to 1.0. There is no error return. The erfc functions return a value in the range 0 to 2. If x is too large for erfc, the errno variable is set to ERANGE.

Because C++ allows overloading, you can call overloads of erf and erfc that take and return float and long double types. In a C program, erf and erfc always take and return a double.

Function

Required header

erf , erff, erfl, erfc, erfcf, erfcl

<math.h>

For additional compatibility information, see Compatibility.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.