share/mk/: build-html: Don't build mbind.2 and set_mempolicy.2
[man-pages.git] / man3 / atan2.3
blobf0df976fa0681b34556b8d78b63c9d2c5fe92d40
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\"     <mtk.manpages@gmail.com>
5 .\"
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\"
8 .\" References consulted:
9 .\"     Linux libc source code
10 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
11 .\"     386BSD man pages
12 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
13 .\" Modified 2002-07-27 by Walter Harms
14 .\"     (walter.harms@informatik.uni-oldenburg.de)
15 .\"
16 .TH atan2 3 (date) "Linux man-pages (unreleased)"
17 .SH NAME
18 atan2, atan2f, atan2l \- arc tangent function of two variables
19 .SH LIBRARY
20 Math library
21 .RI ( libm ", " \-lm )
22 .SH SYNOPSIS
23 .nf
24 .B #include <math.h>
26 .BI "double atan2(double " y ", double " x );
27 .BI "float atan2f(float " y ", float " x );
28 .BI "long double atan2l(long double " y ", long double " x );
29 .fi
31 .RS -4
32 Feature Test Macro Requirements for glibc (see
33 .BR feature_test_macros (7)):
34 .RE
36 .BR atan2f (),
37 .BR atan2l ():
38 .nf
39     _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
40         || /* Since glibc 2.19: */ _DEFAULT_SOURCE
41         || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
42 .fi
43 .SH DESCRIPTION
44 These functions calculate the principal value of the arc tangent of
45 .IR y/x ,
46 using the signs of the two arguments to determine
47 the quadrant of the result.
48 .SH RETURN VALUE
49 On success, these functions return the principal value of the arc tangent of
50 .I y/x
51 in radians; the return value is in the range [\-pi,\ pi].
54 .I y
55 is +0 (\-0) and
56 .I x
57 is less than 0, +pi (\-pi) is returned.
60 .I y
61 is +0 (\-0) and
62 .I x
63 is greater than 0, +0 (\-0) is returned.
66 .I y
67 is less than 0 and
68 .I x
69 is +0 or \-0, \-pi/2 is returned.
72 .I y
73 is greater than 0 and
74 .I x
75 is +0 or \-0, pi/2 is returned.
77 .\" POSIX.1 says:
78 .\" If
79 .\" .I x
80 .\" is 0, a pole error shall not occur.
81 .\"
82 If either
83 .I x
85 .I y
86 is NaN, a NaN is returned.
88 .\" POSIX.1 says:
89 .\" If the result underflows, a range error may occur and
90 .\" .I y/x
91 .\" should be returned.
92 .\"
94 .I y
95 is +0 (\-0) and
96 .I x
97 is \-0, +pi (\-pi) is returned.
100 .I y
101 is +0 (\-0) and
102 .I x
103 is +0, +0 (\-0) is returned.
106 .I y
107 is a finite value greater (less) than 0, and
108 .I x
109 is negative infinity, +pi (\-pi) is returned.
112 .I y
113 is a finite value greater (less) than 0, and
114 .I x
115 is positive infinity, +0 (\-0) is returned.
118 .I y
119 is positive infinity (negative infinity), and
120 .I x
121 is finite,
122 pi/2 (\-pi/2) is returned.
125 .I y
126 is positive infinity (negative infinity) and
127 .I x
128 is negative infinity, +3*pi/4 (\-3*pi/4) is returned.
131 .I y
132 is positive infinity (negative infinity) and
133 .I x
134 is positive infinity, +pi/4 (\-pi/4) is returned.
136 .\" POSIX.1 says:
137 .\" If both arguments are 0, a domain error shall not occur.
138 .SH ERRORS
139 No errors occur.
140 .\" POSIX.1 documents an optional underflow error
141 .\" glibc 2.8 does not do this.
142 .SH ATTRIBUTES
143 For an explanation of the terms used in this section, see
144 .BR attributes (7).
146 allbox;
147 lbx lb lb
148 l l l.
149 Interface       Attribute       Value
153 .BR atan2 (),
154 .BR atan2f (),
155 .BR atan2l ()
156 T}      Thread safety   MT-Safe
158 .SH STANDARDS
159 C11, POSIX.1-2008.
160 .SH HISTORY
161 C99, POSIX.1-2001.
163 The variant returning
164 .I double
165 also conforms to
166 SVr4, 4.3BSD, C89.
167 .SH SEE ALSO
168 .BR acos (3),
169 .BR asin (3),
170 .BR atan (3),
171 .BR carg (3),
172 .BR cos (3),
173 .BR sin (3),
174 .BR tan (3)