Python math.erf() Method
Python math.erf(x) The method returns the error function of a number
math.erf(x) The method accepts values between -inf and +inf and returns a value between -1 and +1.
Python version: 3.2
Syntax
The syntax of the math.erf() method is as follows:
math.erf(x)
Parameter Description:
- x -- required, a number. If x is not a number, a TypeError is returned.
Return Value
A floating-point value representing the error function of a number.
Example
The following example computes the error function of the same positive and negative numbers:
Example
Import the math package
import
math
Output the error function
(
math
.
erf
(
1.28
)
)
(
math
.
erf
(
1.28
)
)
Output result:
0.9297341930135782
-0.9297341930135782
Python math Module