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>
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .\" References consulted:
9 .\" Linux libc source code
10 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
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)
17 .TH cosh 3 (date) "Linux man-pages (unreleased)"
19 cosh, coshf, coshl \- hyperbolic cosine function
22 .RI ( libm ", " \-lm )
27 .BI "double cosh(double " x );
28 .BI "float coshf(float " x );
29 .BI "long double coshl(long double " x );
33 Feature Test Macro Requirements for glibc (see
34 .BR feature_test_macros (7)):
40 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
41 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
42 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
45 These functions return the hyperbolic cosine of
47 which is defined mathematically as:
51 cosh(x) = (exp(x) + exp(\-x)) / 2
55 On success, these functions return the hyperbolic cosine of
60 is a NaN, a NaN is returned.
64 is +0 or \-0, 1 is returned.
68 is positive infinity or negative infinity,
69 positive infinity is returned.
71 If the result overflows,
73 and the functions return
82 for information on how to determine whether an error has occurred
83 when calling these functions.
85 The following errors can occur:
87 Range error: result overflow
91 An overflow floating-point exception
95 For an explanation of the terms used in this section, see
103 Interface Attribute Value
108 T} Thread safety MT-Safe
114 C99, POSIX.1-2001, POSIX.1-2008.
116 The variant returning
121 In glibc 2.3.4 and earlier,
122 an overflow floating-point
124 exception is not raised when an overflow occurs.