cpowf, cpow, cpowl - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

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

### [edit] Parameters

x, y | - | complex argument

### [edit] Return value

The complex power xy
.

### [edit] Example

Run this code

    #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

csqrtcsqrtfcsqrtl (C99)(C99)(C99) | computes the complex square root (function) [edit]
powpowfpowl (C99)(C99) | computes a number raised to the given power (xy) (function) [edit]
C++ documentation for pow

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/numeric/complex/cpow&oldid=70854"