4.7 Complex exponential and power functions

The exponential, log, and power functions may be supplied with complex arguments with specialized meanings that generalize their real counterparts. These versions are only called when the argument is complex.

complex exp(complex z)
Return the complex natural exponential of z, which for \(z = x + yi\) is \[ \exp z = \exp(x) \textrm{cis}(y) = \exp(x) (\cos(y) + i \sin(y)). \]
Available since 2.28

complex log(complex z)
Return the complex natural logarithm of z, which for \(z = \textrm{polar}(r, \theta)\) is \[ \log z = \log r + \theta i. \]
Available since 2.28

complex log10(complex z)
Return the complex common logarithm of z, \[ \log_{10} z = \frac{\log z}{\log 10}. \]
Available since 2.28

complex pow(complex x, complex y)
Return x raised to the power of y, \[ \text{pow}(x,y) = \textrm{exp}(y \, \log(x)). \]
Available since 2.28

complex sqrt(complex x)
Return the complex square root of x with branch cut along the negative real axis. For finite inputs, the result will be in the right half-plane.
Available since 2.28