计算输入弧度的三角余切值,输入参数为弧度。
C interface:
float cotf(float x);
double cot(double x);
long double cotl(long double x);
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
x |
|
表示弧度角的浮点值。 |
输入 |
C: "km.h"
// 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("cot(1.0) = %.15f\n", cot(x1)); printf("cot(-1.0) = %.15f\n", cot(x2)); printf("cot(0.5) = %.15f\n", cot(x3)); printf("cot(-0.5) = %.15f\n", cot(x4)); printf("cot(0.0) = %.15f\n", cot(a)); printf("cot(-0.0) = %.15f\n", cot(-a)); printf("cot(INFINITY) = %.15f\n", cot(b)); printf("cot(-INFINITY) = %.15f\n", cot(c)); printf("cot(NAN) = %.15f\n", cot(d)); /* * cot(1.0) = -0.642092615934331 * cot(-1.0) = 0.642092615934331 * cot(0.5) = 1.830487721712452 * cot(-0.5) = -1.830487721712452 * cot(0.0) = inf * cot(-0.0) = -inf * cot(INFINITY) = nan * cot(-INFINITY) = nan * cot(NAN) = nan * * */