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>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" References consulted:
8 .\" Linux libc source code
9 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
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)"
16 cos, cosf, cosl \- cosine function
19 .RI ( libm ", " \-lm )
24 .BI "double cos(double " x );
25 .BI "float cosf(float " x );
26 .BI "long double cosl(long double " x );
30 Feature Test Macro Requirements for glibc (see
31 .BR feature_test_macros (7)):
37 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
38 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
39 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
42 These functions return the cosine of
49 On success, these functions return the cosine of
54 is a NaN, a NaN is returned.
58 is positive infinity or negative infinity,
59 a domain error occurs,
60 and a NaN is returned.
64 for information on how to determine whether an error has occurred
65 when calling these functions.
67 The following errors can occur:
69 Domain error: \fIx\fP is an infinity
74 An invalid floating-point exception
78 For an explanation of the terms used in this section, see
86 Interface Attribute Value
91 T} Thread safety MT-Safe
97 C99, POSIX.1-2001, POSIX.1-2008.
104 Before version 2.10, the glibc implementation did not set
105 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6780
109 when a domain error occurred.