cpowl Function

Calculates the complex power function xy for long double precision complex values.

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

Include

<complex.h>

Prototype

long double complex cpowl(long double complex x, long double 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)
{
  long double complex x, y, z;
  x = -2.0 + 1.0*I;
  y = 0.2 - 1.3*I;
  z = cpowl(x, y);
  printf("The complex value %Lf + %Lfi raised to the value %Lf + %Lfi is %Lf + %Lfi\n", creall(x), cimagl(x), creall(y), cimagl(y), creall(z), cimagl(z));

}

Example Output

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