powr?i?/powi?i?
计算不同类别的参数的幂函数值。
接口定义
C interface:
complex double powc16i4(complex double x, int y);
complex double powc16i4_18(complex double x, int y);
int powi4i4(int x, int y);
int powi4i4_18(int x, int y);
int64_t powi8i4(int64_t x, int y);
int64_t powi8i4_18(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);
powc16i4_18、powi4i4_18仅在高精度版本提供。
依赖
C: "km.h"
示例
C interface:
// typical usage printf("powi4i4(1, 2) = %d\n", powi4i4(1, 2)); printf("powi4i4(3, 4) = %d\n", powi4i4(3, 4)); printf("powr4i4(1.0, 2) = %.15f\n", powr4i4(1.0, 2)); printf("powr4i4(3.0, 4) = %.15f\n", powr4i4(3.0, 4)); printf("powr4i4(INFINITY, 2) = %.15f\n", powr4i4(INFINITY, 2)); printf("powr4i4(INFINITY, 3) = %.15f\n", powr4i4(INFINITY, 3)); printf("powr4i4(-INFINITY, 3) = %.15f\n", powr4i4(-INFINITY, 3)); /* * powi4i4(1, 2) = 1 * powi4i4(3, 4) = 81 * powr4i4(1.0, 2) = 1.000000000000000 * powr4i4(3.0, 4) = 81.000000000000000 * powr4i4(INFINITY, 2) = inf * powr4i4(INFINITY, 3) = inf * powr4i4(-INFINITY, 3) = -inf * * */
父主题: 幂和根函数