Méthode math.exp() de Python

Python math 模块Module math de Python

Python math.exp(x)La méthode renvoie e élevé à la puissance x Ex, où e = 2.718281... est la base du logarithme népérien.

Version Python : 1.6.1

Syntaxe

La syntaxe de la méthode math.exp() est la suivante :

math.exp(x)

Description du paramètre :

  • x-- Requis, un nombre, spécifiant l'exposant. Si x n'est pas un nombre, renvoie TypeError.

Valeur de retour

Une valeur à virgule flottante représentant e élevé à la puissance x.

Exemple

L'exemple suivant spécifie différents exposants :

Exemple

# Importer le package math
import math

# Spécifier différents exposants
print(math.exp(65))
print(math.exp(-6.89))

Résultat de sortie :

1.6948892444103338e+28
0.0010179138409954387

Python math 模块Module math de Python

Autres extensions