powr?i?
计算不同类别的参数的幂函数值。
接口定义
C interface:
double powr8i4(double x, int y);
complex double powc16i4(complex double x, int y);
int powi4i4(int x, int y);
int64_t powi8i4(int64_t x, int y);
int64_t powi8i8(int64_t x, int64_t y);
float powr4i4(float x, int y);
double powr8i4(double x, int y);
long double powr16i4(long double x, int y);
依赖
C: "km.h"
示例
C interface:
// typical usage double x1 = 1.0, x2 = 2.0, x3 = 3.0, x4 = 4.0; int y1 = 4, y2 = -4, y3 = -3, y4 = 3; // special handing double a = INFINITY, b = -INFINITY, c = NAN, d = 0.0; // print result printf("pow(1.0, 4) = %.15f\n", pow(x1, y1)); printf("pow(2.0, -4) = %.15f\n", pow(x2, y2)); printf("pow(3.0, -3) = %.15f\n", pow(x3, y3)); printf("pow(4.0, 3) = %.15f\n", pow(x4, y4)); printf("pow(INFINITY, 4) = %+.15f\n", pow(a, y1); printf("pow(INFINITY, -4) = %+.15f\n", pow(a, y2)); printf("pow(-INFINITY, -3) = %+.15f\n", pow(b, y3)); printf("pow(NAN, 3) = %+.15f\n", pow(c, y4)); printf("pow(0.0, -3) = %+.15f\n", pow(d, y3)); printf("pow(-0.0, -3) = %+.15f\n", pow(e, y3)); /* * pow(1.0, 4) = 1.000000000000000 * pow(2.0, -4) = 0.062500000000000 * pow(3.0, -3) = 0.037037037037037 * pow(4.0, 3) = 64.000000000000000 * pow(INFINITY, 4) = inf * pow(INFINITY, -4) = 0.000000000000000 * pow(-INFINITY, -3) = -0.000000000000000 * pow(NAN, 3) = nan * pow(0.0, -3) = inf * pow(-0.0, -3) = -inf * * */
父主题: 函数定义