Full name
math.erf
Library
math
Syntax
math.erf(x)
Description
The math.erf function returns the value of the error function (also called the Gauss error function ) for a given x value.
The error function is given by the following expression:
And its graph is the following:
Parameters
- x: Value for which we want to obtain the Gauss error function.
Result
The math.erf function returns a real number.
Examples
We can obtain the value of the Gauss error function for the point x = 0.5 with the following code:
math.erf(0.5)
0.5204998778130465