A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/cmath/erf/ below:

function

<cmath> <ctgmath>

erf
     double erf  (double x);      float erff (float x);long double erfl (long double x);
     double erf (double x);      float erf (float x);long double erf (long double x);     double erf (T x);           // additional overloads for integral types

Compute error function

Returns the error function value for x.

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;
}

Output:
erf (1.000000) = 0.842701


See also
erfc
Compute complementary error function (function)
lgamma
Compute log-gamma function (function)
tgamma
Compute gamma function (function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4