Python math.exp() Method
Python math.exp(x) The method returns e raised to the power of x, where e = 2.718281... is the base of natural logarithms.
Python version: 1.6.1
Syntax
The syntax of the math.exp() method is as follows:
math.exp(x)
Parameter Description:
- x -- required, a number specifying the exponent. If x is not a number, a TypeError is returned.
Return Value
A floating-point value representing e raised to the power of x.
Example
The following example specifies different exponents:
Example
Import the math package
import
math
Specify different exponents
(
math
.
exp
(
65
)
)
(
math
.
exp
(
6.89
)
)
Output result:
1.6948892444103338e+28
0.0010179138409954387
Python math Module