TAN 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

tanf, tan, tanl, tanw, tanq, tanll, tandf, tand, tandl, tandll - tangent function

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float tanf (float x);

extern double tan (double x);

extern long double tanl (long double x);

extern __float80 tanw (__float80 x);

extern __float128 tanq (__float128 x);

extern long_long_double tanll (long_long_double x);

extern decimal_float tandf (decimal_float x);

extern decimal_double tand (decimal_double x);

extern decimal_long_double tandl (decimal_long_double x);

extern decimal_long_long_double tandll (decimal_long_long_double x);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the tangent of x, where the argument is measured in radians.

RETURN VALUES

If the argument is finite, its tangent is returned. Otherwise, a NaN is returned.

Caution: Since the tangent 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.


ERRORS

If the argument is a NaN, errno is set to EDOM, and the argument is returned. If the argument is +Infinity or -Infinity, errno is set to EDOM, and a quiet NaN is returned.

SEE ALSO

acos(3CW), acosp(3CW), acospi(3CW), asin(3CW), asinp(3CW), asinpi(3CW), atan(3CW), atan2(3CW), atan2p(3CW), atan2pi(3CW), atanp(3CW), atanpi(3CW), cos(3CW), cosdeg(3CW), cosp(3CW), cospi(3CW), cotan(3CW), cotandeg(3CW), cotanp(3CW), cotanpi(3CW), ereduce(3CW), eriduce(3CW), sin(3CW), sincos(3CW), sincosp(3CW), sincospi(3CW), sindeg(3CW), sinp(3CW), sinpi(3CW), tandeg(3CW), tanp(3CW), tanpi(3CW).