Python cmath.exp() Method
Example
Find the exponential of a complex number:
#import cmath for complex number operations
import cmath
#find
the exponential of a complex number
print (cmath.exp(2 + 3j))
Try it Yourself »
Definition and Usage
The cmath.exp()
method accepts a complex
number and returns the exponential value. If the number is x, it returns e**x
where e is the base of natural logarithms.
Syntax
cmath.exp(x)
Parameter Values
Parameter | Description |
---|---|
x | Required. A number to find exponential value of. |
Technical Details
Return Value: | A complex value, representing the exponential of a
complex number |
---|---|
Python Version: | 1.5 |