math.exp

Full name
math.exp
Library
math
Syntax

math.exp(x)

Description

The math.exp function raises the number e (2.718281...) to the power given as an argument.

As stated in the Python documentation, this function is more accurate than math.e ** x, or pow(math.e, x).

Parameters
  • x: Power to raise the number e.
Result

The math.exp function returns a real number.

Examples

We can square the number e with the following code:

math.exp(2)

7.38905609893065

Submitted by admin on Fri, 01/29/2021 - 15:57