]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
5bb52d98 MK |
2 | .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk |
3 | .\" <mtk.manpages@gmail.com> | |
fea681da | 4 | .\" |
93015253 | 5 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
6 | .\" Permission is granted to make and distribute verbatim copies of this |
7 | .\" manual provided the copyright notice and this permission notice are | |
8 | .\" preserved on all copies. | |
9 | .\" | |
10 | .\" Permission is granted to copy and distribute modified versions of this | |
11 | .\" manual under the conditions for verbatim copying, provided that the | |
12 | .\" entire resulting derived work is distributed under the terms of a | |
13 | .\" permission notice identical to this one. | |
c13182ef | 14 | .\" |
fea681da MK |
15 | .\" Since the Linux kernel and libraries are constantly changing, this |
16 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
17 | .\" responsibility for errors or omissions, or for damages resulting from | |
18 | .\" the use of the information contained herein. The author(s) may not | |
19 | .\" have taken the same level of care in the production of this manual, | |
20 | .\" which is licensed free of charge, as they might when working | |
21 | .\" professionally. | |
c13182ef | 22 | .\" |
fea681da MK |
23 | .\" Formatted or processed versions of this manual, if unaccompanied by |
24 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 25 | .\" %%%LICENSE_END |
fea681da MK |
26 | .\" |
27 | .\" References consulted: | |
28 | .\" Linux libc source code | |
29 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
30 | .\" 386BSD man pages | |
31 | .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) | |
32 | .\" Modified 1996-06-08 by aeb | |
33 | .\" Modified 2002-07-27 by Walter Harms | |
34 | .\" (walter.harms@informatik.uni-oldenburg.de) | |
35 | .\" | |
97986708 | 36 | .TH COSH 3 2016-03-15 "" "Linux Programmer's Manual" |
fea681da MK |
37 | .SH NAME |
38 | cosh, coshf, coshl \- hyperbolic cosine function | |
39 | .SH SYNOPSIS | |
40 | .nf | |
41 | .B #include <math.h> | |
68e4db0a | 42 | .PP |
fea681da MK |
43 | .BI "double cosh(double " x ); |
44 | .br | |
45 | .BI "float coshf(float " x ); | |
46 | .br | |
47 | .BI "long double coshl(long double " x ); | |
48 | .fi | |
68e4db0a | 49 | .PP |
20c58d70 | 50 | Link with \fI\-lm\fP. |
68e4db0a | 51 | .PP |
5bb52d98 MK |
52 | .in -4n |
53 | Feature Test Macro Requirements for glibc (see | |
54 | .BR feature_test_macros (7)): | |
55 | .in | |
68e4db0a | 56 | .PP |
5bb52d98 MK |
57 | .ad l |
58 | .BR coshf (), | |
59 | .BR coshl (): | |
b90c43a8 | 60 | .RS 4 |
e9d91bcf MK |
61 | _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L |
62 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE | |
63 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
b90c43a8 MK |
64 | .RE |
65 | .ad | |
fea681da | 66 | .SH DESCRIPTION |
5600f73a | 67 | These functions return the hyperbolic cosine of |
022671eb | 68 | .IR x , |
5600f73a | 69 | which is defined mathematically as: |
658670de MK |
70 | .nf |
71 | ||
72 | cosh(x) = (exp(x) + exp(\-x)) / 2 | |
494fc522 | 73 | .fi |
47297adb | 74 | .SH RETURN VALUE |
5bb52d98 MK |
75 | On success, these functions return the hyperbolic cosine of |
76 | .IR x . | |
77 | ||
78 | If | |
79 | .I x | |
80 | is a NaN, a NaN is returned. | |
81 | ||
82 | If | |
83 | .I x | |
84 | is +0 or \-0, 1 is returned. | |
85 | ||
86 | If | |
87 | .I x | |
88 | is positive infinity or negative infinity, | |
89 | positive infinity is returned. | |
90 | ||
91 | If the result overflows, | |
efe294cb | 92 | a range error occurs, |
5bb52d98 MK |
93 | and the functions return |
94 | .RB + HUGE_VAL , | |
95 | .RB + HUGE_VALF , | |
96 | or | |
97 | .RB + HUGE_VALL , | |
98 | respectively. | |
99 | .SH ERRORS | |
100 | See | |
101 | .BR math_error (7) | |
102 | for information on how to determine whether an error has occurred | |
103 | when calling these functions. | |
104 | .PP | |
105 | The following errors can occur: | |
106 | .TP | |
107 | Range error: result overflow | |
108 | .I errno | |
109 | is set to | |
110 | .BR ERANGE . | |
111 | An overflow floating-point exception | |
112 | .RB ( FE_OVERFLOW ) | |
113 | is raised. | |
87e3f2df MS |
114 | .SH ATTRIBUTES |
115 | For an explanation of the terms used in this section, see | |
116 | .BR attributes (7). | |
117 | .TS | |
118 | allbox; | |
119 | lbw24 lb lb | |
120 | l l l. | |
121 | Interface Attribute Value | |
122 | T{ | |
123 | .BR cosh (), | |
124 | .BR coshf (), | |
125 | .BR coshl () | |
126 | T} Thread safety MT-Safe | |
127 | .TE | |
47297adb | 128 | .SH CONFORMING TO |
9a74e018 | 129 | C99, POSIX.1-2001, POSIX.1-2008. |
e05e3635 | 130 | |
5bb52d98 MK |
131 | The variant returning |
132 | .I double | |
133 | also conforms to | |
134 | SVr4, 4.3BSD. | |
47836143 MK |
135 | .SH BUGS |
136 | In glibc version 2.3.4 and earlier, | |
137 | an overflow floating-point | |
138 | .RB ( FE_OVERFLOW ) | |
139 | exception is not raised when an overflow occurs. | |
47297adb | 140 | .SH SEE ALSO |
fea681da MK |
141 | .BR acosh (3), |
142 | .BR asinh (3), | |
143 | .BR atanh (3), | |
1e321034 | 144 | .BR ccos (3), |
fea681da MK |
145 | .BR sinh (3), |
146 | .BR tanh (3) |