Python Tutorial Python Advanced Python References Python Libraries

Python cmath - e Constant



The Python cmath.e constant is used to return the value of e to the available precision. It returns the value of e as 2.718281828459045.

Syntax

cmath.e

Parameters

No parameter is required.

Return Value

Returns the value of e to the available precision.

Example:

In the example below, cmath.e constant is used to return the value of e to the available precision.

import cmath

print(cmath.log(cmath.e))
print(cmath.log10(cmath.e))

The output of the above code will be:

(1+0j)
(0.43429448190325176+0j)

❮ Python cMath Module