Namespaces
Variants
Views
Actions

cpowf, cpow, cpowl

From cppreference.com
< c‎ | numeric‎ | complex
Revision as of 07:32, 10 February 2014 by Cubbi (Talk | contribs)

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

Parameters

x, y - complex argument

Return value

The complex power xy
.

Example

#include <stdio.h>
#include <complex.h>
 
int main()
{    
    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

See also

(C99)(C99)(C99)
computes the complex square root
(function) [edit]
(C99)(C99)(C99)
computes the complex base-e exponential
(function) [edit]