share/mk/: Fix includes
[man-pages.git] / man3 / cos.3
blob4df1ae43ca9cf7b53ee611d427c2e4cf4b9d7a2b
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\"     <mtk.manpages@gmail.com>
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 (faith@cs.unc.edu)
13 .\" Modified 2002-07-27 by Walter Harms
14 .\"     (walter.harms@informatik.uni-oldenburg.de)
15 .TH cos 3 (date) "Linux man-pages (unreleased)"
16 .SH NAME
17 cos, cosf, cosl \- cosine function
18 .SH LIBRARY
19 Math library
20 .RI ( libm ", " \-lm )
21 .SH SYNOPSIS
22 .nf
23 .B #include <math.h>
25 .BI "double cos(double " x );
26 .BI "float cosf(float " x );
27 .BI "long double cosl(long double " x );
28 .fi
30 .RS -4
31 Feature Test Macro Requirements for glibc (see
32 .BR feature_test_macros (7)):
33 .RE
35 .BR cosf (),
36 .BR cosl ():
37 .nf
38     _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
39         || /* Since glibc 2.19: */ _DEFAULT_SOURCE
40         || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41 .fi
42 .SH DESCRIPTION
43 These functions return the cosine of
44 .IR x ,
45 where
46 .I x
48 given in radians.
49 .SH RETURN VALUE
50 On success, these functions return the cosine of
51 .IR x .
54 .I x
55 is a NaN, a NaN is returned.
58 .I x
59 is positive infinity or negative infinity,
60 a domain error occurs,
61 and a NaN is returned.
62 .SH ERRORS
63 See
64 .BR math_error (7)
65 for information on how to determine whether an error has occurred
66 when calling these functions.
68 The following errors can occur:
69 .TP
70 Domain error: \fIx\fP is an infinity
71 .I errno
72 is set to
73 .B EDOM
74 (but see BUGS).
75 An invalid floating-point exception
76 .RB ( FE_INVALID )
77 is raised.
78 .SH ATTRIBUTES
79 For an explanation of the terms used in this section, see
80 .BR attributes (7).
81 .TS
82 allbox;
83 lbx lb lb
84 l l l.
85 Interface       Attribute       Value
87 .na
88 .nh
89 .BR cos (),
90 .BR cosf (),
91 .BR cosl ()
92 T}      Thread safety   MT-Safe
93 .TE
94 .SH STANDARDS
95 C11, POSIX.1-2008.
96 .SH HISTORY
97 C89, POSIX.1-2001.
99 The variant returning
100 .I double
101 also conforms to
102 SVr4, 4.3BSD.
103 .SH BUGS
104 Before glibc 2.10, the glibc implementation did not set
105 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6780
106 .I errno
108 .B EDOM
109 when a domain error occurred.
110 .SH SEE ALSO
111 .BR acos (3),
112 .BR asin (3),
113 .BR atan (3),
114 .BR atan2 (3),
115 .BR ccos (3),
116 .BR sin (3),
117 .BR sincos (3),
118 .BR tan (3)