1COS(3) Linux Programmer's Manual COS(3)
2
3
4
6 cos, cosf, cosl - cosine function
7
9 #include <math.h>
10
11 double cos(double x);
12 float cosf(float x);
13 long double cosl(long double x);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 cosf(), cosl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
20 _ISOC99_SOURCE; or cc -std=c99
21
23 The cos() function returns the cosine of x, where x is given in radi‐
24 ans.
25
27 On success, these functions return the cosine of x.
28
29 If x is a NaN, a NaN is returned.
30
31 If x is positive infinity or negative infinity, a domain error occurs,
32 and a NaN is returned.
33
35 See math_error(7) for information on how to determine whether an error
36 has occurred when calling these functions.
37
38 The following errors can occur:
39
40 Domain error: x is an infinity
41 An invalid floating-point exception (FE_INVALID) is raised.
42
43 These functions do not set errno.
44
46 C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
47 4.3BSD.
48
50 acos(3), asin(3), atan(3), atan2(3), ccos(3), sin(3), sincos(3), tan(3)
51
53 This page is part of release 3.22 of the Linux man-pages project. A
54 description of the project, and information about reporting bugs, can
55 be found at http://www.kernel.org/doc/man-pages/.
56
57
58
59 2009-02-04 COS(3)