1ACOS(3P) POSIX Programmer's Manual ACOS(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 acos, acosf, acosl — arc cosine functions
13
15 #include <math.h>
16
17 double acos(double x);
18 float acosf(float x);
19 long double acosl(long double x);
20
22 The functionality described on this reference page is aligned with the
23 ISO C standard. Any conflict between the requirements described here
24 and the ISO C standard is unintentional. This volume of POSIX.1‐2017
25 defers to the ISO C standard.
26
27 These functions shall compute the principal value of the arc cosine of
28 their argument x. The value of x should be in the range [-1,1].
29
30 An application wishing to check for error situations should set errno
31 to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these
32 functions. On return, if errno is non-zero or fetestexcept(FE_INVALID |
33 FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has
34 occurred.
35
37 Upon successful completion, these functions shall return the arc cosine
38 of x, in the range [0,π] radians.
39
40 For finite values of x not in the range [-1,1], a domain error shall
41 occur, and either a NaN (if supported), or an implementation-defined
42 value shall be returned.
43
44 If x is NaN, a NaN shall be returned.
45
46 If x is +1, +0 shall be returned.
47
48 If x is ±Inf, a domain error shall occur, and a NaN shall be returned.
49
51 These functions shall fail if:
52
53 Domain Error
54 The x argument is finite and is not in the range [-1,1], or
55 is ±Inf.
56
57 If the integer expression (math_errhandling & MATH_ERRNO)
58 is non-zero, then errno shall be set to [EDOM]. If the
59 integer expression (math_errhandling & MATH_ERREXCEPT) is
60 non-zero, then the invalid floating-point exception shall
61 be raised.
62
63 The following sections are informative.
64
66 None.
67
69 On error, the expressions (math_errhandling & MATH_ERRNO) and
70 (math_errhandling & MATH_ERREXCEPT) are independent of each other, but
71 at least one of them must be non-zero.
72
74 None.
75
77 None.
78
80 cos(), feclearexcept(), fetestexcept(), isnan()
81
82 The Base Definitions volume of POSIX.1‐2017, Section 4.20, Treatment of
83 Error Conditions for Mathematical Functions, <math.h>
84
86 Portions of this text are reprinted and reproduced in electronic form
87 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
88 table Operating System Interface (POSIX), The Open Group Base Specifi‐
89 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
90 Electrical and Electronics Engineers, Inc and The Open Group. In the
91 event of any discrepancy between this version and the original IEEE and
92 The Open Group Standard, the original IEEE and The Open Group Standard
93 is the referee document. The original Standard can be obtained online
94 at http://www.opengroup.org/unix/online.html .
95
96 Any typographical or formatting errors that appear in this page are
97 most likely to have been introduced during the conversion of the source
98 files to man page format. To report such errors, see https://www.ker‐
99 nel.org/doc/man-pages/reporting_bugs.html .
100
101
102
103IEEE/The Open Group 2017 ACOS(3P)