]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/cos.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / cos.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .\" References consulted:
8 .\" Linux libc source code
9 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" 386BSD man pages
11 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
12 .\" Modified 2002-07-27 by Walter Harms
13 .\" (walter.harms@informatik.uni-oldenburg.de)
14 .TH COS 3 2021-03-22 "Linux man-pages (unreleased)"
15 .SH NAME
16 cos, cosf, cosl \- cosine function
17 .SH LIBRARY
18 Math library
19 .RI ( libm ", " \-lm )
20 .SH SYNOPSIS
21 .nf
22 .B #include <math.h>
23 .PP
24 .BI "double cos(double " x );
25 .BI "float cosf(float " x );
26 .BI "long double cosl(long double " x );
27 .fi
28 .PP
29 .RS -4
30 Feature Test Macro Requirements for glibc (see
31 .BR feature_test_macros (7)):
32 .RE
33 .PP
34 .BR cosf (),
35 .BR cosl ():
36 .nf
37 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
38 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
39 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
40 .fi
41 .SH DESCRIPTION
42 These functions return the cosine of
43 .IR x ,
44 where
45 .I x
46 is
47 given in radians.
48 .SH RETURN VALUE
49 On success, these functions return the cosine of
50 .IR x .
51 .PP
52 If
53 .I x
54 is a NaN, a NaN is returned.
55 .PP
56 If
57 .I x
58 is positive infinity or negative infinity,
59 a domain error occurs,
60 and a NaN is returned.
61 .SH ERRORS
62 See
63 .BR math_error (7)
64 for information on how to determine whether an error has occurred
65 when calling these functions.
66 .PP
67 The following errors can occur:
68 .TP
69 Domain error: \fIx\fP is an infinity
70 .I errno
71 is set to
72 .B EDOM
73 (but see BUGS).
74 An invalid floating-point exception
75 .RB ( FE_INVALID )
76 is raised.
77 .SH ATTRIBUTES
78 For an explanation of the terms used in this section, see
79 .BR attributes (7).
80 .ad l
81 .nh
82 .TS
83 allbox;
84 lbx lb lb
85 l l l.
86 Interface Attribute Value
87 T{
88 .BR cos (),
89 .BR cosf (),
90 .BR cosl ()
91 T} Thread safety MT-Safe
92 .TE
93 .hy
94 .ad
95 .sp 1
96 .SH STANDARDS
97 C99, POSIX.1-2001, POSIX.1-2008.
98 .PP
99 The variant returning
100 .I double
101 also conforms to
102 SVr4, 4.3BSD.
103 .SH BUGS
104 Before version 2.10, the glibc implementation did not set
105 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6780
106 .I errno
107 to
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)