C examples for complex.h:pow
function template
<complex> <complex.h>
template<class T> complex<T> pow (const complex<T>& x, int y); 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);
Power of complex
exp(y*log(x))
Parameter | Description |
---|---|
x | Base value. |
y | Exponent value. |
#include <iostream> // std::cout #include <complex> // std::complex, std::polar int main ()//from w ww . j av a2 s.c o m { std::complex<double> mycomplex (3.0,4.0); std::cout << " is " << std::pow (mycomplex, 0.5) << '\n'; return 0; }