Easy Tutorial
❮ Python Joseph Life Dead Game Python Sort Dictionaries By Key Or Value ❯

Python math.erf() Method

Python math Module

The math.erf(x) method in Python returns the error function of a number.

The math.erf(x) method accepts values between -inf and +inf, and returns values between -1 and +1.

Python Version: 3.2

Syntax

The syntax for the math.erf() method is as follows:

math.erf(x)

Parameter:

Return Value

A floating-point value representing the error function of a number.

Example

The following example calculates the error function for positive and negative numbers:

# Import math package
import math

# Output the error function
print(math.erf(1.28))
print(math.erf(-1.28))

Output:

0.9297341930135782
-0.9297341930135782

Python math Module

❮ Python Joseph Life Dead Game Python Sort Dictionaries By Key Or Value ❯