tanpi
计算输入实数与π相乘的正切值。
接口定义
C interface:
float tanpif(float x);
double tanpi(double x);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
x |
|
表示输入数据的浮点值。 |
输入 |
返回值
- 返回x乘以π的正切函数值y=tan(x * π)。
- 输入+0,返回+0。
- 输入-0,返回-0。
- 输入±∞,返回nan。
- 输入nan,返回nan。
依赖
C: "km.h"
示例
C interface:
// typical usage float x1 = -0.2, x2 = 0.2, x3 = 0.4, x4 = -0.4; // special handling float a = 0.0, b = INFINITY, c = -INFINITY, d = NAN; // print result printf("tanpi(0.2) = %.15f\n", tanpi(x1)); printf("tanpi(-0.2) = %.15f\n", tanpi(x2)); printf("tanpi(0.4) = %.15f\n", tanpi(x3)); printf("tanpi(-0.4) = %.15f\n", tanpi(x4)); printf("tanpi(0.0) = %.15f\n", tanpi(a)); printf("tanpi(-0.0) = %.15f\n", tanpi(-a)); printf("tanpi(INFINITY) = %.15f\n", tanpi(b)); printf("tanpi(-INFINITY) = %.15f\n", tanpi(c)); printf("tanpi(NAN) = %.15f\n", tanpi(d)); /* * tanpi(0.2) = -0.726542542310257 * tanpi(-0.2) = 0.726542542310257 * tanpi(0.4) = 3.077683733269691 * tanpi(-0.4) = -3.077683733269691 * tanpi(0.0) = 0.000000000000000 * tanpi(-0.0) = -0.000000000000000 * tanpi(INFINITY) = nan * tanpi(-INFINITY) = nan * tanpi(NAN) = nan * */
父主题: 三角函数