cpow
Act as the pow interface for complex numbers.
Interface Definition
C interface:
float complex cpowf(float complex x, float complex y);
double complex cpow(double complex x, double complex y);
long double complex cpowl(long double complex x, long double complex y);
Fortran interface:
RES = POWF(X, Y)
RES = POW(X, Y)
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
x |
|
Floating-point value of the input data. |
Input |
y |
|
Floating-point value of the input data. |
Input |
Dependencies
C: "km.h"
Examples
C interface:
1 2 3 4 5 6 7 8 9 10 11 12 13 | double x1 = 1.0, x2 = 2.0, x3 = 3.0, x4 = 4.0; double complex cx1 = __builtin_complex(x1, x2); double complex cx2 = __builtin_complex(x3, x4); // print result double ry; double iy; ry = __real__ cpow(cx1, cx2); iy = __imag__ cpow(cx1, cx2); printf("cpow(cx1, cx2) = %.15f, %.15f\n", ry, iy); /* * cpow(cx1, cx2) = 0.129009594074467, 0.033924092905170 * */ |
Fortran interface:
REAL(8) :: X = 3.0
REAL(8) :: Y = -3.0
PRINT*, POW(X, Y)
!
! OUTPUT
! 0.037037037037037
!
Parent topic: Complex Functions