cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ] #include <mathcw.h> extern float cotanf (float x); extern double cotan (double x); extern long double cotanl (long double x); extern __float80 cotanw (__float80 x); extern __float128 cotanq (__float128 x); extern long_long_double cotanll (long_long_double x); extern decimal_float cotandf (decimal_float x); extern decimal_double cotand (decimal_double x); extern decimal_long_double cotandl (decimal_long_double x); extern decimal_long_long_double cotandll (decimal_long_long_double x);
NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.
Caution: Since the cotangent is a periodic function on [0,+pi], arguments outside that range must be reduced to that range by subtracting a suitable multiple of pi. For large arguments, significance loss from that subtraction can lower the accuracy of the reduced argument, possibly to the point where there are no significant digits left. Accuracy is therefore unavoidably reduced for arguments of large magnitude. However, argument reduction in this implementation is exact for nondecimal bases, so accuracy is maintained over the entire floating-point range. In decimal arithmetic, when no meaningful argument reduction is possible, a NaN is returned.