Python math.erf()
Anonymous contributor
Published Aug 24, 2024
Contribute to Docs
The math.erf() function returns the error function of a number.
Syntax
math.erf(n)
n: A real number for which the error function is to be computed.
The math.erf() function accepts any real number from negative infinity to positive infinity as input and returns a value between -1 and 1, representing the error function of that number.
Example
In the example below, math.erf() returns the error function of 1:
import mathprint(math.erf(1))
The above code gives the following output:
0.8427007929497149
Codebyte Example
Run the following example that uses the math.erf() function to understand its working:
All contributors
- Anonymous contributor
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Python on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours
- Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.
- With Certificate
- Beginner Friendly.24 hours