]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
e279ffc3 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-25 by Walter Harms | |
13 | .\" (walter.harms@informatik.uni-oldenburg.de) | |
14 | .\" | |
45186a5d | 15 | .TH ACOS 3 2021-03-22 "Linux man-pages (unreleased)" |
fea681da MK |
16 | .SH NAME |
17 | acos, acosf, acosl \- arc cosine function | |
2af19291 AC |
18 | .SH LIBRARY |
19 | Math library | |
8fc3b2cf | 20 | .RI ( libm ", " \-lm ) |
fea681da MK |
21 | .SH SYNOPSIS |
22 | .nf | |
23 | .B #include <math.h> | |
68e4db0a | 24 | .PP |
fea681da MK |
25 | .BI "double acos(double " x ); |
26 | .BI "float acosf(float " x ); | |
27 | .BI "long double acosl(long double " x ); | |
28 | .fi | |
68e4db0a | 29 | .PP |
d39ad78f | 30 | .RS -4 |
e279ffc3 MK |
31 | Feature Test Macro Requirements for glibc (see |
32 | .BR feature_test_macros (7)): | |
d39ad78f | 33 | .RE |
68e4db0a | 34 | .PP |
e279ffc3 MK |
35 | .BR acosf (), |
36 | .BR acosl (): | |
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 | 43 | These functions calculate the arc cosine of |
022671eb MK |
44 | .IR x ; |
45 | that is | |
46 | the value whose cosine is | |
47 | .IR x . | |
47297adb | 48 | .SH RETURN VALUE |
e279ffc3 | 49 | On success, these functions return the arc cosine of |
1ae6b2c7 | 50 | .I x |
e279ffc3 | 51 | in radians; the return value is in the range [0,\ pi]. |
847e0d88 | 52 | .PP |
e279ffc3 MK |
53 | If |
54 | .I x | |
55 | is a NaN, a NaN is returned. | |
847e0d88 | 56 | .PP |
e279ffc3 MK |
57 | If |
58 | .I x | |
59 | is +1, | |
60 | +0 is returned. | |
847e0d88 | 61 | .PP |
e279ffc3 MK |
62 | If |
63 | .I x | |
64 | is positive infinity or negative infinity, | |
efe294cb | 65 | a domain error occurs, |
e279ffc3 | 66 | and a NaN is returned. |
847e0d88 | 67 | .PP |
e279ffc3 MK |
68 | If |
69 | .I x | |
70 | is outside the range [\-1,\ 1], | |
efe294cb | 71 | a domain error occurs, |
e279ffc3 | 72 | and a NaN is returned. |
fea681da | 73 | .SH ERRORS |
e279ffc3 MK |
74 | See |
75 | .BR math_error (7) | |
76 | for information on how to determine whether an error has occurred | |
77 | when calling these functions. | |
78 | .PP | |
79 | The following errors can occur: | |
fea681da | 80 | .TP |
e279ffc3 MK |
81 | Domain error: \fIx\fP is outside the range [\-1,\ 1] |
82 | .I errno | |
83 | is set to | |
84 | .BR EDOM . | |
85 | An invalid floating-point exception | |
86 | .RB ( FE_INVALID ) | |
87 | is raised. | |
44dc6b32 MS |
88 | .SH ATTRIBUTES |
89 | For an explanation of the terms used in this section, see | |
90 | .BR attributes (7). | |
c466875e MK |
91 | .ad l |
92 | .nh | |
44dc6b32 MS |
93 | .TS |
94 | allbox; | |
c466875e | 95 | lbx lb lb |
44dc6b32 MS |
96 | l l l. |
97 | Interface Attribute Value | |
98 | T{ | |
99 | .BR acos (), | |
100 | .BR acosf (), | |
101 | .BR acosl () | |
102 | T} Thread safety MT-Safe | |
103 | .TE | |
c466875e MK |
104 | .hy |
105 | .ad | |
106 | .sp 1 | |
3113c7f3 | 107 | .SH STANDARDS |
9a74e018 | 108 | C99, POSIX.1-2001, POSIX.1-2008. |
847e0d88 | 109 | .PP |
e279ffc3 MK |
110 | The variant returning |
111 | .I double | |
112 | also conforms to | |
113 | SVr4, 4.3BSD, C89. | |
47297adb | 114 | .SH SEE ALSO |
fea681da MK |
115 | .BR asin (3), |
116 | .BR atan (3), | |
117 | .BR atan2 (3), | |
36268806 | 118 | .BR cacos (3), |
fea681da MK |
119 | .BR cos (3), |
120 | .BR sin (3), | |
121 | .BR tan (3) |