Debian Codegraph @

upstream/debian-trixie/man3/acos.3

raw
1 '\" t
2 .\" Copyright 1993 David Metcalfe ([email protected])
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\" <[email protected]>
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 ([email protected])
13 .\" Modified 2002-07-25 by Walter Harms
14 .\" ([email protected])
15 .\"
16 .TH acos 3 2024-05-02 "Linux man-pages 6.9.1"
17 .SH NAME
18 acos, acosf, acosl \- arc cosine function
19 .SH LIBRARY
20 Math library
21 .RI ( libm ", " \-lm )
22 .SH SYNOPSIS
23 .nf
24 .B #include <math.h>
25 .P
26 .BI "double acos(double " x );
27 .BI "float acosf(float " x );
28 .BI "long double acosl(long double " x );
29 .fi
30 .P
31 .RS -4
32 Feature Test Macro Requirements for glibc (see
33 .BR feature_test_macros (7)):
34 .RE
35 .P
36 .BR acosf (),
37 .BR acosl ():
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 arc cosine of
45 .IR x ;
46 that is
47 the value whose cosine is
48 .IR x .
49 .SH RETURN VALUE
50 On success, these functions return the arc cosine of
51 .I x
52 in radians; the return value is in the range [0,\ pi].
53 .P
54 If
55 .I x
56 is a NaN, a NaN is returned.
57 .P
58 If
59 .I x
60 is +1,
61 +0 is returned.
62 .P
63 If
64 .I x
65 is positive infinity or negative infinity,
66 a domain error occurs,
67 and a NaN is returned.
68 .P
69 If
70 .I x
71 is outside the range [\-1,\ 1],
72 a domain error occurs,
73 and a NaN is returned.
74 .SH ERRORS
75 See
76 .BR math_error (7)
77 for information on how to determine whether an error has occurred
78 when calling these functions.
79 .P
80 The following errors can occur:
81 .TP
82 Domain error: \fIx\fP is outside the range [\-1,\ 1]
83 .I errno
84 is set to
85 .BR EDOM .
86 An invalid floating-point exception
87 .RB ( FE_INVALID )
88 is raised.
89 .SH ATTRIBUTES
90 For an explanation of the terms used in this section, see
91 .BR attributes (7).
92 .TS
93 allbox;
94 lbx lb lb
95 l l l.
96 Interface Attribute Value
97 T{
98 .na
99 .nh
100 .BR acos (),
101 .BR acosf (),
102 .BR acosl ()
103 T} Thread safety MT-Safe
104 .TE
105 .SH STANDARDS
106 C11, POSIX.1-2008.
107 .SH HISTORY
108 C99, POSIX.1-2001.
109 .P
110 The variant returning
111 .I double
112 also conforms to
113 C89, SVr4, 4.3BSD.
114 .SH SEE ALSO
115 .BR asin (3),
116 .BR atan (3),
117 .BR atan2 (3),
118 .BR cacos (3),
119 .BR cos (3),
120 .BR sin (3),
121 .BR tan (3)