#C 语言标准库函数 cosd128
#include <math.h>
_Decimal128 cosd128(_Decimal128 x);
说明
求弧度角的余弦。
很大的有限角度由实现进行参数归约。IEC 60559 实现对无穷输入报告无效浮点异常。
自 C23 起提供。需要实现定义 __STDC_IEC_60559_DFP__ 并提供对应的十进制浮点接口。
参数
x- 以弧度度量的角。
返回值
- 返回结果,在 [-1, 1] 内。
#示例
使用 GCC 时,在链接命令末尾添加 -lm。
#include <math.h>
#include <stdio.h>
int main(void)
{
printf("%.9Lg\n", (long double)cosd128(0.5dl));
return 0;
}
#相关接口
- 接口变体 cos、cosf、cosl、cosd32、cosd64
- 类型通用分派 cos(类型通用宏)
- 相关操作 acosd128、acospid128、cospid128、sind128、tand128