What is math.exp() in Python?

The exp() function returns the mathematical e raised to the power of a specific number. Here, e is the base of the natural logarithm. Figure 1 shows the mathematical representation of the exp() function.

Figure 1: Mathematical representation of the exp() function

The math module is required to use this function.

Syntax

exp(number)

Parameter

This function requires a number as a parameter.

Return value

exp() returns the mathematical e raised to the power of the specific number sent as a parameter.

Code

import math
#positive number
print "exp(10) : ", math.exp(10)
#negative number
print "exp(-2) : ", math.exp(-2)
#zero
print "exp(0) : ", math.exp(0)