erf - C math.h

C examples for math.h:erf

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

Returns the error function value for x.

Prototype

long double erfl (long double x);
long double erf (long double x);
     double erf  (double x);
      float erff (float x);
      float erf (float x);
     double erf (T x);           

Parameters

Parameter Description
x Parameter for the error function.

Return Value

Error function value for x.

Example

Demo Code


#include <stdio.h>
#include <math.h> /* erf */

int main ()/*from www.  ja  va2s .co m*/
{
  double param = 1.0;
  double result = erf (param);
  printf ("erf (%f) = %f\n", param, result );
  return 0;
}

Related Tutorials