1acos(3)                    Library Functions Manual                    acos(3)
2
3
4

NAME

6       acos, acosf, acosl - arc cosine function
7

LIBRARY

9       Math library (libm, -lm)
10

SYNOPSIS

12       #include <math.h>
13
14       double acos(double x);
15       float acosf(float x);
16       long double acosl(long double x);
17
18   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20       acosf(), acosl():
21           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
22               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23               || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24

DESCRIPTION

26       These  functions calculate the arc cosine of x; that is the value whose
27       cosine is x.
28

RETURN VALUE

30       On success, these functions return the arc cosine of x in radians;  the
31       return value is in the range [0, pi].
32
33       If x is a NaN, a NaN is returned.
34
35       If x is +1, +0 is returned.
36
37       If  x is positive infinity or negative infinity, a domain error occurs,
38       and a NaN is returned.
39
40       If x is outside the range [-1, 1], a domain error occurs, and a NaN  is
41       returned.
42

ERRORS

44       See  math_error(7) for information on how to determine whether an error
45       has occurred when calling these functions.
46
47       The following errors can occur:
48
49       Domain error: x is outside the range [-1, 1]
50              errno is set  to  EDOM.   An  invalid  floating-point  exception
51              (FE_INVALID) is raised.
52

ATTRIBUTES

54       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
55       tributes(7).
56
57       ┌────────────────────────────────────────────┬───────────────┬─────────┐
58Interface                                   Attribute     Value   
59       ├────────────────────────────────────────────┼───────────────┼─────────┤
60acos(), acosf(), acosl()                    │ Thread safety │ MT-Safe │
61       └────────────────────────────────────────────┴───────────────┴─────────┘
62

STANDARDS

64       C11, POSIX.1-2008.
65

HISTORY

67       C99, POSIX.1-2001.
68
69       The variant returning double also conforms to C89, SVr4, 4.3BSD.
70

SEE ALSO

72       asin(3), atan(3), atan2(3), cacos(3), cos(3), sin(3), tan(3)
73
74
75
76Linux man-pages 6.04              2023-03-30                           acos(3)
Impressum