Metoda Python math.erf().
Příklad
Funkce tiskové chyby pro různá čísla:
# Import math Library
import math
# Print error function for
different
numbers
print (math.erf(0.67))
print (math.erf(1.34))
print
(math.erf(-6))
Definice a použití
Metoda math.erf()
vrací chybovou funkci čísla.
Tato metoda přijímá hodnotu mezi - inf a + inf a vrací hodnotu mezi - 1 až + 1.
Syntax
math.erf(x)
Hodnoty parametrů
Parameter | Description |
---|---|
x | Required. A number to find the error function of |
Technické údaje
Návratová hodnota: | Hodnota float představující chybovou funkci čísla |
---|---|
Verze Pythonu: | 3.2 |
Další příklady
Příklad
Vypočítejte matematickou chybovou funkci stejného čísla, kladného a záporného:
print (math.erf(1.28))
print (math.erf(-1.28))