Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python math.exp() Method

Python math.exp() Method

Python math Module Python math Module

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:

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

print

(

math

.

exp

(

65

)

)

print

(

math

.

exp

(

6.89

)

)

Output result:


1.6948892444103338e+28
0.0010179138409954387

Python math Module Python math Module