Método Python math.expm1()
Ejemplo
Encuentra el valor exponencial de un número - 1:
#Import math Library
import math
#Return the exponential value of
a number - 1
print(math.expm1(32))
print(math.expm1(-10.89))
Definición y uso
El math.expm1()
método devuelve E x - 1.
'E' es la base del sistema natural de logaritmos (aproximadamente 2,718282) yx es el número que se le pasa.
Esta función es más precisa que llamar y restar 1.
math.exp()
Sintaxis
math.expm1(x)
Valores paramétricos
Parameter | Description |
---|---|
x | Required. Specifies the exponent |
Detalles técnicos
Valor devuelto: | Un float valor, que representa E x - 1 |
---|---|
Versión de Python: | 2.7 |