Latest web development tutorials

() La fonction de python3

python3 numérique python3 numérique


description

exp () renvoie l'indice de x, x e.


grammaire

Ce qui suit est la syntaxe de méthode exp ():

import math

math.exp( x )

Note: exp () ne sont pas directement accessibles, nous avons besoin d'importer le module de mathématiques, invoquer la méthode par objet statique.


Paramètres

  • x - expression numérique.

Valeur de retour

Retour l'exposant de x, x e.

Exemples

L'exemple suivant illustre l'utilisation de exp () méthode Exemple:

#!/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))

Après avoir exécuté l'exemple ci-dessus est sortie:

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 numérique python3 numérique