Namespaces
Variants
Views
Actions

std::exp(std::complex)

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 06:15, 12 March 2014 by Cubbi (Talk | contribs)

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

Parameters

z - complex value

Return value

e raised to a complex power.

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)

See also

returns e raised to the given power (ex)
(function) [edit]
complex power, one or both arguments may be a complex number
(function template) [edit]
complex natural logarithm with the branch cuts along the negative real axis
(function template) [edit]