Home >>Python math Module >Python math.exp() Method

Python math.exp() Method

Python math.exp() Method

Python math.exp() Method in python is used to return the number in the exponential (Ex) format and it accepts only a number. where E is Euler's number (approximately 2.718281...).

Syntax:
math.exp(x)

Parameter Values

Parameter Description
x It is required a number to float.
Here is an Example of Python math.exp() Method:

import math
print(math.exp(23))
print(math.exp(-1.23))

Output:
9744803446.248903
0.2922925776808594
Example 2:

import math
v = 1
w = 0
x = 203.2
y = -12.45
z = -76.04
print("exp(v): ", math.exp(v))
print("exp(w): ", math.exp(w))
print("exp(x): ", math.exp(x))
print("exp(y): ", math.exp(y))
print("exp(z): ", math.exp(z))

Output:
exp(v): 2.718281828459045
exp(w): 1.0
exp(x): 1.7727141967006295e+88
exp(y): 3.917722766024335e-06
exp(z): 9.467767754189014e-34

No Sidebar ads