cpowf, cpow, cpowl

From cppreference.com
< c‎ | numeric‎ | complex
Defined in header <complex.h>
float complex       cpowf( float complex x, float complex y );
(since C99)
double complex      cpow( double complex x, double complex y );
(since C99)
long double complex cpowl( long double complex x, long double complex y );
(since C99)

Computes the complex power function xy
, with branch cut for the first parameter along the negative real axis.

Contents

[edit] Parameters

x, y - complex argument

[edit] Return value

The complex power xy
.

[edit] Example

#include <stdio.h>
#include <complex.h>
 
int main(void)
{    
    double complex z = cpow(1.0+2.0*I,2.0+0.0*I);
    printf("%f%+fi\n", creal(z), cimag(z));
 
    z = cpow(1.0+2.0*I,1.0+2.0*I);
    printf("%f%+fi\n", creal(z), cimag(z));
 
    return 0;
}

Output:

-3.000000+4.000000i
-0.222517+0.100709i

[edit] See also

(C99)(C99)(C99)
computes the complex square root
(function)
(C99)(C99)
computes a number raised to the given power (xy)
(function)