中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助
鲲鹏小智

tand

计算输入角度的正切值。

接口定义

C interface:

float tandf(float x);

double tand(double x);

long double tandl(long double x);

参数

参数名

类型

描述

输入/输出

x

  • 在tandf中,x是单精度浮点类型。
  • 在tand中,x是双精度浮点类型。
  • 在tandl中,x是长双精度浮点类型。

表示角度的浮点值。

输入

返回值

  • 正常区间:返回角度值x的正切值。
  • 输入x = 180 * k,(k为整数),输出为±0。
  • 输入x = 180 * k + 90,(k为整数),输出为±inf。
  • 输入|x| = inf or 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("tand(1.0) = %.15f\n", tand(x1));
printf("tand(-1.0) = %.15f\n", tand(x2));
printf("tand(0.5) = %.15f\n", tand(x3));
printf("tand(-0.5) = %.15f\n", tand(x4));
printf("tand(0.0) = %.15f\n", tand(a));
printf("tand(-0.0) = %.15f\n", tand(-a));
printf("tand(INFINITY) = %.15f\n", tand(b));
printf("tand(-INFINITY) = %.15f\n", tand(c));
printf("tand(NAN) = %.15f\n", tand(d));
/*
 *  tand(1.0) = -0.017455064928218
 *  tand(-1.0) = 0.017455064928218
 *  tand(0.5) = 0.008726867790759
 *  tand(-0.5) = -0.008726867790759
 *  tand(0.0) = 0.000000000000000
 *  tand(-0.0) = -0.000000000000000
 *  tand(INFINITY) = nan
 *  tand(-INFINITY) = nan
 *  tand(NAN) = nan
 *
 * */
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词