6.2.49 cpowf Function

Calculates the complex power function xy for single precision complex values.

Attention: This function is implemented only by MPLAB XC32 C compilers.

Include

<complex.h>

Prototype

float complex cpowf(float complex x, float complex y);

Arguments

x
the base value
y
the exponent, or power, value

Return Value

Returns the complex power function xy, with a branch cut for the base value (x) along the negative real axis.

Example

See the notes at the beginning of this chapter or section for information on using printf() or scanf() (and other functions reading and writing the stdin or stdout streams) in the example code.

#include <stdio.h>
#include <complex.h>

int main(void)
{
  float complex x, y, z;
  x = -2.0 + 1.0*I;
  y = 0.2 - 1.3*I;
  z = cpowf(x, y);
  printf("The complex value %f + %fi raised to the value %f + %fi is %f + %fi\n", crealf(x), cimagf(x), crealf(y), cimagf(y), crealf(z), cimagf(z));

}

Example Output

The complex value -2.000000 + 1.000000i raised to the value 0.200000 + -1.300000i is 33.309896 + -18.656049i