Home >>Python math Module >Python math.erf() Method

Python math.erf() Method

Python math.erf() Method

Python math.erf() Method in python is used to returns the complementary error function of a number, it is also known as gauss error function. It accepts a value range between [-a, a], and returns the error function in between [-1,1].

Syntax:
math.erf(x)

Parameter Values

Parameter Description
x It is required a number for finding the error function
Here is an example of Python math.erf() Method:

import math
print (math.erf(2.34))
print (math.erf(0.12))
print (math.erf(-2))

Output:
0.9990645698610919
0.13475835181992007
-0.9953222650189527
Example 2:

import math
print (math.erf(3.17))
print (math.erf(-3.17))

Output:
0.9999926418732864
-0.9999926418732864