Previous Page
Next Page

cpow

Raises a complex number to a complex power

#include <complex.h>
double complex cpow ( double complex x , double complex y  );
float complex cpowf ( float complex x , float complex y  );
long double complex cpowl ( long double complex x , long double complex y  );

The cpow( ) function raises its first complex argument x to the power of the second argument, y. In other words, it returns the value of xy.

The cpow( ) function has a branch cut along the negative real axis to yield a unique result.

Example

double complex z = 0.0 + 2.7 * I;
double complex w = 2.7 + 0.0 * I;

double complex c = cpow(w, z);   // Raise e to the power of i*2.7

printf("%.2f %+.2f \xD7 I raised to the power of %.2f %+.2f \xD7 I "
       "is %.2f %+.2f \xD7 I.\n",
       creal(w), cimag(w), creal(z), cimag(z), creal(c), cimag(c));

This code produces the following output:

2.70 +0.00 x I raised to the power of 0.00 +2.70 x I is -0.90 +0.44 x I.

See Also

The corresponding function for real numbers, pow( ); the complex math functions cexp( ), clog( ), cpow( ), csqrt( )


Previous Page
Next Page