Método Python math.log1p()
Ejemplo
Encuentre el registro (1 + número) para diferentes números
# 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))
Definición y uso
El math.log1p()
método devuelve log(1+número), calculado de una manera precisa incluso cuando el valor de número es cercano a cero.
Sintaxis
math.log1p(x)
Valores paramétricos
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 |
Detalles técnicos
Valor devuelto: | Un float valor, que representa el valor logarítmico de 1+ número |
---|---|
Versión de Python: | 2.6 |