tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / cosh.3
blobd35b977ea3a8a3556ff7f625a777a126c117d2b5
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\"     <mtk.manpages@gmail.com>
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 (faith@cs.unc.edu)
13 .\" Modified 1996-06-08 by aeb
14 .\" Modified 2002-07-27 by Walter Harms
15 .\" (walter.harms@informatik.uni-oldenburg.de)
16 .\"
17 .TH cosh 3 (date) "Linux man-pages (unreleased)"
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 .PP
27 .BI "double cosh(double " x );
28 .BI "float coshf(float " x );
29 .BI "long double coshl(long double " x );
30 .fi
31 .PP
32 .RS -4
33 Feature Test Macro Requirements for glibc (see
34 .BR feature_test_macros (7)):
35 .RE
36 .PP
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 .PP
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 .PP
59 .I x
60 is a NaN, a NaN is returned.
61 .PP
63 .I x
64 is +0 or \-0, 1 is returned.
65 .PP
67 .I x
68 is positive infinity or negative infinity,
69 positive infinity is returned.
70 .PP
71 If the result overflows,
72 a range error occurs,
73 and the functions return
74 .RB + HUGE_VAL ,
75 .RB + HUGE_VALF ,
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 .PP
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 .ad l
98 .nh
99 .TS
100 allbox;
101 lbx lb lb
102 l l l.
103 Interface       Attribute       Value
105 .BR cosh (),
106 .BR coshf (),
107 .BR coshl ()
108 T}      Thread safety   MT-Safe
112 .sp 1
113 .SH STANDARDS
114 C99, POSIX.1-2001, POSIX.1-2008.
116 The variant returning
117 .I double
118 also conforms to
119 SVr4, 4.3BSD.
120 .SH BUGS
121 In glibc 2.3.4 and earlier,
122 an overflow floating-point
123 .RB ( FE_OVERFLOW  )
124 exception is not raised when an overflow occurs.
125 .SH SEE ALSO
126 .BR acosh (3),
127 .BR asinh (3),
128 .BR atanh (3),
129 .BR ccos (3),
130 .BR sinh (3),
131 .BR tanh (3)