std::exp(std::complex)

From cppreference.com
< cpp‎ | numeric‎ | complex
Defined in header <complex>
template< class T >
complex<T> exp( const complex<T>& z );

Compute e (Euler's number, 2.7182818) raised to the complex base-e exponential of x.

Contents

[edit] Parameters

z - complex value

[edit] Return value

e raised to a complex power.

[edit] Example

#include <complex>
#include <iostream>
 
int main()
{
   const double pi = std::acos(-1);
   const std::complex<double> i(0, 1);
 
   std::cout << std::fixed << " exp(i*pi) = " << std::exp(i * pi) << '\n';
}

Output:

exp(i*pi) = (-1.000000,0.000000)

[edit] See also

complex natural logarithm with the branch cuts along the negative real axis
(function template)
returns e raised to the given power (ex)
(function)
applies the function std::exp to each element of valarray
(function template)
C documentation for cexp