math.exp()
Anonymous contributor
Published May 19, 2021Updated Mar 17, 2024
Contribute to Docs
The math.exp()
method returns e raised to the power of a number.
Syntax
math.exp(x)
e is approximately 2.718282.
Example
Use math.exp()
to return e raised to the power of 5
:
import mathprint(math.exp(5))
The above code gives the following output:
148.4131591025766
Use math.exp()
to return e raised to the power of 3
:
import mathprint(math.exp(3))
The above code gives the following output:
20.085536923187668
Codebyte Example
Run the following example that uses the math.exp()
function to understand its working:
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.