##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# 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`.

### [edit] Parameters

z | - | complex value

### [edit] Return value

e raised to a complex power.

### [edit] Example

Run this code

    #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

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

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/complex/exp&oldid=70895"