Header <tgmath.h> provides a type-generic macro version of this function.
Additional overloads are provided in this header (<cmath>) for the integral types: These overloads effectively cast x to a double before calculations (defined for T being any integral type).
Parameters
x
Parameter for the error function.
Return Value
Error function value for x.
Example
1 2 3 4 5 6 7 8 9 10 11 12
/* erf example */
#include <stdio.h> /* printf */
#include <math.h> /* erf */
int main ()
{
double param, result;
param = 1.0;
result = erf (param);
printf ("erf (%f) = %f\n", param, result );
return 0;
}