atanpi
计算输入实数的反正切值除以π。
接口定义
C interface:
float atanpif(float x);
double atanpi(double x);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
x |
|
表示输入数据的浮点值。 |
输入 |
返回值
- 正常区间:返回输入实数x的反正切函数值除以π的值y=atan(x) / π,y ∈ [-0.5, +0.5]。
- 特殊区间:如下所示。
输入值(x)
输出值(y)
+0
+0
-0
-0
+inf
0.5
-inf
-0.5
nan
nan
依赖
C: "km.h"
示例
C interface:
// typical usage float x1 = -1.0, x2 = 1.0, x3 = 0.5, x4 = -0.5; // special handling float a = 0.0, b = INFINITY, c = -INFINITY, d = NAN; // print result printf("atanpi(1.0) = %.15f\n", atanpi(x1)); printf("atanpi(-1.0) = %.15f\n", atanpi(x2)); printf("atanpi(0.5) = %.15f\n", atanpi(x3)); printf("atanpi(-0.5) = %.15f\n", atanpi(x4)); printf("atanpi(0.0) = %.15f\n", atanpi(a)); printf("atanpi(-0.0) = %.15f\n", atanpi(-a)); printf("atanpi(INFINITY) = %.15f\n", atanpi(b)); printf("atanpi(-INFINITY) = %.15f\n", atanpi(c)); printf("atanpi(NAN) = %.15f\n", atanpi(d)); /* * atanpi(1.0) = -0.250000000000000 * atanpi(-1.0) = 0.250000000000000 * atanpi(0.5) = 0.147583617650433 * atanpi(-0.5) = -0.147583617650433 * atanpi(0.0) = 0.000000000000000 * atanpi(-0.0) = -0.000000000000000 * atanpi(INFINITY) = 0.500000000000000 * atanpi(-INFINITY) = -0.500000000000000 * atanpi(NAN) = nan * * */
父主题: 三角函数