Python math.log1p() Metodo
Esempio
Trova il registro (1+numero) per numeri diversi
# Import math Library
import math
# Return the log(1+number) for different numbers
print(math.log1p(2.7183))
print(math.log1p(2))
print(math.log1p(1))
Definizione e utilizzo
Il math.log1p()
metodo restituisce log(1+numero), calcolato in modo accurato anche quando il valore di numero è vicino a zero.
Sintassi
math.log1p(x)
Valori dei parametri
Parameter | Description |
---|---|
x | Required. Specifies the number to process. If the value is a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError |
Dettagli tecnici
Valore di ritorno: | Un float valore, che rappresenta il valore di registro di 1+ numero |
---|---|
Versione Python: | 2.6 |