]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/cosh.3
e6e32d231ef1e521df4a20ba6b07d5803b3f45a7
[thirdparty/man-pages.git] / man3 / cosh.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 1996-06-08 by aeb
13 .\" Modified 2002-07-27 by Walter Harms
14 .\" (walter.harms@informatik.uni-oldenburg.de)
15 .\"
16 .TH COSH 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
17 .SH NAME
18 cosh, coshf, coshl \- hyperbolic cosine function
19 .SH LIBRARY
20 Math library
21 .RI ( libm ", " \-lm )
22 .SH SYNOPSIS
23 .nf
24 .B #include <math.h>
25 .PP
26 .BI "double cosh(double " x );
27 .BI "float coshf(float " x );
28 .BI "long double coshl(long double " x );
29 .fi
30 .PP
31 .RS -4
32 Feature Test Macro Requirements for glibc (see
33 .BR feature_test_macros (7)):
34 .RE
35 .PP
36 .BR coshf (),
37 .BR coshl ():
38 .nf
39 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
40 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
41 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
42 .fi
43 .SH DESCRIPTION
44 These functions return the hyperbolic cosine of
45 .IR x ,
46 which is defined mathematically as:
47 .PP
48 .in +4n
49 .EX
50 cosh(x) = (exp(x) + exp(\-x)) / 2
51 .EE
52 .in
53 .SH RETURN VALUE
54 On success, these functions return the hyperbolic cosine of
55 .IR x .
56 .PP
57 If
58 .I x
59 is a NaN, a NaN is returned.
60 .PP
61 If
62 .I x
63 is +0 or \-0, 1 is returned.
64 .PP
65 If
66 .I x
67 is positive infinity or negative infinity,
68 positive infinity is returned.
69 .PP
70 If the result overflows,
71 a range error occurs,
72 and the functions return
73 .RB + HUGE_VAL ,
74 .RB + HUGE_VALF ,
75 or
76 .RB + HUGE_VALL ,
77 respectively.
78 .SH ERRORS
79 See
80 .BR math_error (7)
81 for information on how to determine whether an error has occurred
82 when calling these functions.
83 .PP
84 The following errors can occur:
85 .TP
86 Range error: result overflow
87 .I errno
88 is set to
89 .BR ERANGE .
90 An overflow floating-point exception
91 .RB ( FE_OVERFLOW )
92 is raised.
93 .SH ATTRIBUTES
94 For an explanation of the terms used in this section, see
95 .BR attributes (7).
96 .ad l
97 .nh
98 .TS
99 allbox;
100 lbx lb lb
101 l l l.
102 Interface Attribute Value
103 T{
104 .BR cosh (),
105 .BR coshf (),
106 .BR coshl ()
107 T} Thread safety MT-Safe
108 .TE
109 .hy
110 .ad
111 .sp 1
112 .SH STANDARDS
113 C99, POSIX.1-2001, POSIX.1-2008.
114 .PP
115 The variant returning
116 .I double
117 also conforms to
118 SVr4, 4.3BSD.
119 .SH BUGS
120 In glibc version 2.3.4 and earlier,
121 an overflow floating-point
122 .RB ( FE_OVERFLOW )
123 exception is not raised when an overflow occurs.
124 .SH SEE ALSO
125 .BR acosh (3),
126 .BR asinh (3),
127 .BR atanh (3),
128 .BR ccos (3),
129 .BR sinh (3),
130 .BR tanh (3)