cpow
函数pow的复数接口。
接口定义
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);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
x |
|
表示输入数据的浮点值。 |
输入 |
y |
|
表示输入数据的浮点值。 |
输入 |
依赖
C: "km.h"
示例
C interface:
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 !
父主题: 复数函数