]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/tan.3
Many pages: wfix
[thirdparty/man-pages.git] / man3 / tan.3
CommitLineData
fea681da 1.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
769cb8d5
MK
2.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3.\" <mtk.manpages@gmail.com>
fea681da 4.\"
5fbde956 5.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
6.\"
7.\" References consulted:
8.\" Linux libc source code
9.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10.\" 386BSD man pages
11.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
12.\" Modified 2002-07-27 by Walter Harms
13.\" (walter.harms@informatik.uni-oldenburg.de)
14.\"
4c1c5274 15.TH tan 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
16.SH NAME
17tan, tanf, tanl \- tangent function
9ae4bbdc
AC
18.SH LIBRARY
19Math library
8fc3b2cf 20.RI ( libm ", " \-lm )
fea681da
MK
21.SH SYNOPSIS
22.nf
23.B #include <math.h>
68e4db0a 24.PP
fea681da 25.BI "double tan(double " x );
fea681da 26.BI "float tanf(float " x );
fea681da
MK
27.BI "long double tanl(long double " x );
28.fi
68e4db0a 29.PP
d39ad78f 30.RS -4
769cb8d5
MK
31Feature Test Macro Requirements for glibc (see
32.BR feature_test_macros (7)):
d39ad78f 33.RE
68e4db0a 34.PP
769cb8d5
MK
35.BR tanf (),
36.BR tanl ():
9d2adbae 37.nf
5c10d2c5 38 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
9d2adbae
MK
39 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
40 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41.fi
fea681da 42.SH DESCRIPTION
5600f73a 43These functions return the tangent of
022671eb
MK
44.IR x ,
45where
46.I x
47is
fea681da 48given in radians.
769cb8d5
MK
49.SH RETURN VALUE
50On success, these functions return the tangent of
51.IR x .
847e0d88 52.PP
769cb8d5
MK
53If
54.I x
55is a NaN, a NaN is returned.
847e0d88 56.PP
769cb8d5
MK
57If
58.I x
59is positive infinity or negative infinity,
efe294cb 60a domain error occurs,
769cb8d5 61and a NaN is returned.
847e0d88 62.PP
769cb8d5 63If the correct result would overflow,
efe294cb 64a range error occurs,
769cb8d5
MK
65and the functions return
66.BR HUGE_VAL ,
67.BR HUGE_VALF ,
68or
69.BR HUGE_VALL ,
70respectively, with the mathematically correct sign.
71.\" I think overflow can't occur, because the closest floating-point
72.\" representation of pi/2 is still not close enough to pi/2 to
73.\" produce a large enough value to overflow.
74.\" Testing certainly seems to bear this out. -- mtk, Jul 08
75.\"
76.\" POSIX.1 allows an optional underflow error;
77.\" glibc 2.8 doesn't do this
78.\" POSIX.1 an optional range error for subnormal x;
79.\" glibc 2.8 doesn't do this
80.SH ERRORS
81See
82.BR math_error (7)
83for information on how to determine whether an error has occurred
84when calling these functions.
85.PP
86The following errors can occur:
87.TP
88Domain error: \fIx\fP is an infinity
e4723578
MK
89.I errno
90is set to
d8a86e74 91.B EDOM
e4723578 92(but see BUGS).
769cb8d5
MK
93An invalid floating-point exception
94.RB ( FE_INVALID )
95is raised.
96.TP
97Range error: result overflow
98.\" Unable to test this case, since the best approximation of
99.\" pi/2 in double precision only yields a tan() value of 1.633e16.
100.\" .I errno
101.\" is set to
102.\" .BR ERANGE .
103An overflow floating-point exception
104.RB ( FE_OVERFLOW )
105is raised.
7501f871 106.SH ATTRIBUTES
4a9d4776
PH
107For an explanation of the terms used in this section, see
108.BR attributes (7).
c466875e
MK
109.ad l
110.nh
4a9d4776
PH
111.TS
112allbox;
c466875e 113lbx lb lb
4a9d4776
PH
114l l l.
115Interface Attribute Value
116T{
7501f871
PH
117.BR tan (),
118.BR tanf (),
7501f871 119.BR tanl ()
4a9d4776
PH
120T} Thread safety MT-Safe
121.TE
c466875e
MK
122.hy
123.ad
124.sp 1
3113c7f3 125.SH STANDARDS
9a74e018 126C99, POSIX.1-2001, POSIX.1-2008.
847e0d88 127.PP
769cb8d5
MK
128The variant returning
129.I double
130also conforms to
68e1685c 131SVr4, 4.3BSD, C89.
e4723578 132.SH BUGS
b324e17d 133Before glibc 2.10, the glibc implementation did not set
e4723578
MK
134.\" http://sourceware.org/bugzilla/show_bug.cgi?id=6782
135.I errno
136to
137.B EDOM
138when a domain error occurred.
47297adb 139.SH SEE ALSO
fea681da
MK
140.BR acos (3),
141.BR asin (3),
142.BR atan (3),
143.BR atan2 (3),
144.BR cos (3),
36268806 145.BR ctan (3),
fea681da 146.BR sin (3)