Python3 función exp()

Python3 数字Números Python3


Descripción

El método exp() devuelve el exponente de x, ex。


Sintaxis

A continuación se muestra la sintaxis del método exp():

import math

math.exp( x )

Nota:No se puede acceder directamente a exp(); es necesario importar el módulo math y llamar a este método a través del objeto estático.


Parámetros

  • x -- expresión numérica.

Valor de retorno

Devuelve el exponente de x, ex。

Ejemplo

El siguiente ejemplo muestra el uso del método exp():

#!/usr/bin/python3
import math   # 导入 math 模块

print ("math.exp(-45.17) : ", math.exp(-45.17))
print ("math.exp(100.12) : ", math.exp(100.12))
print ("math.exp(100.72) : ", math.exp(100.72))
print ("math.exp(math.pi) : ", math.exp(math.pi))

El resultado de ejecutar el ejemplo anterior es:

math.exp(-45.17) :  2.4150062132629406e-20
math.exp(100.12) :  3.0308436140742566e+43
math.exp(100.72) :  5.522557130248187e+43
math.exp(math.pi) :  23.140692632779267

Python3 数字Números Python3

Otras extensiones