Python math.erf() Method
Example
Calculate the mathematical error function of different numbers:
# Import math Library
import math
# Print the error function of
different
numbers
print (math.erf(0.67))
print (math.erf(1.34))
print
(math.erf(-6))
Try it Yourself »
Definition and Usage
The math.erf() method returns the error function of a number.
Error functions usually occur in probability, statistics and partial differential equation describing diffusion.
The math.erf() method accepts a value range between [-x, x], and returns the error function in between [-1,1].
Note: erf(-x)==-erf(x), error function of a negative number is negative.
Syntax
math.erf(x)
Parameter Values
| Parameter | Description |
|---|---|
| x | Required. The number to find the error function of |
Technical Details
| Return Value: | A float value, representing the error function of a number |
|---|---|
| Python Version: | 3.2 |
More Examples
Example
Calculate the mathematical error function of the same number, positive and negative:
print (math.erf(1.28))
print (math.erf(-1.28))
Try it Yourself »


