#C 语言标准库宏 atanpi
下面以函数形式说明宏的调用接口。
#include <tgmath.h>
generic_result atanpi(generic_value x);
说明
求反正切的主值,再用 π 作为单位表示角度。 示例的实参类型选择 atanpif。
接受任意有限实数。在 IEC 60559 实现中,无穷参数得到带相应符号的 0.5。
适用的二进制实浮点类型和整数参与分派。含 long double 时选长双精度版本,否则含 double 或整数时选双精度版本,其余选择 float 版本。 实现支持十进制重载时,不能把其参与分派的十进制实参和二进制浮点或复数实参混用。
自 C23 起提供。
参数
x- 参与运算的实浮点值。
返回值
- 返回以 π 为单位的角,范围为 [-0.5, 0.5]。
#示例
使用 GCC 时,在链接命令末尾添加 -lm。
#include <tgmath.h>
#include <stdio.h>
int main(void)
{
printf("%.9Lg\n", (long double)atanpi(1.0f));
return 0;
}
#相关接口
- 类型通用分派 atanpi、atanpil、atanpid32、atanpid64、atanpid128
- 相关操作 atan(类型通用宏)、atan2(类型通用宏)、atan2pi(类型通用宏)、tan(类型通用宏)、tanpi(类型通用宏)