##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::pow(std::complex)

From cppreference.com
< cpp‎ | numeric‎ | complex

Defined in header `<complex>` |  |
template< class T > complex<T> pow( const complex<T>& x, const complex<T>& y); |  |
template< class T > complex<T> pow( const complex<T>& x, const T& y); |  |
template< class T > complex<T> pow( const T& x, const complex<T>& y); |  |
template< class T, class U > complex</*Promoted*/> pow( const complex<T>& x, const complex<U>& y); |  | (since C++11)
template< class T, class U > complex</*Promoted*/> pow( const complex<T>& x, const U& y); |  | (since C++11)
template< class T, class U > complex</*Promoted*/> pow( const T& x, const complex<U>& y); |  | (since C++11)

Computes complex `x` raised to a complex power `y`. The operation is defined as exp(y · log(x) ). A branch cut exists along the negative real axis.

The result of pow(0, 0) is implementation-defined.

(since C++11)Additional overloads are provided for all arithmetic types, such that

  1. If either argument is long double or std::complex<long double>, then both arguments are cast to std::complex<long double>
  2. Otherwise, if either argument is double, std::complex<double> or integer type, then both arguments are cast to std::complex<double>
  3. Otherwise, if either argument is float or std::complex<float>, then both arguments are cast to std::complex<float>

### [edit] Parameters

x | - | base as a complex value
y | - | exponent as a complex value

### [edit] Return value

`x` raised to a power `y`.

### [edit] See also

exp(std::complex) | complex base e exponential (function template) [edit]
sqrt(std::complex) | complex square root in the range of the right half-plane (function template) [edit]

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