Debian Codegraph @

upstream/debian-unstable/man3/acos.3

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