Debian Codegraph @

upstream/debian-trixie/man3/cosh.3

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