Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python math.erf() Method

Python math.erf() Method

Python math Module Python math Module

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:

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

print

(

math

.

erf

(

1.28

)

)

print

(

math

.

erf

(

1.28

)

)

Output result:


0.9297341930135782
-0.9297341930135782

Python math Module Python math Module