Python math.erf() Metodo
Esempio
Funzione di errore di stampa per numeri diversi:
# 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))
Definizione e utilizzo
Il math.erf()
metodo restituisce la funzione di errore di un numero.
Questo metodo accetta un valore compreso tra - inf e + inf e restituisce un valore compreso tra - 1 e + 1.
Sintassi
math.erf(x)
Valori dei parametri
Parameter | Description |
---|---|
x | Required. A number to find the error function of |
Dettagli tecnici
Valore di ritorno: | Un float valore, che rappresenta la funzione di errore di un numero |
---|---|
Versione Python: | 3.2 |
Altri esempi
Esempio
Calcola la funzione di errore matematico dello stesso numero, positivo e negativo:
print (math.erf(1.28))
print (math.erf(-1.28))