1cosh(3) Library Functions Manual cosh(3)
2
3
4
6 cosh, coshf, coshl - hyperbolic cosine function
7
9 Math library (libm, -lm)
10
12 #include <math.h>
13
14 double cosh(double x);
15 float coshf(float x);
16 long double coshl(long double x);
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 coshf(), coshl():
21 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
22 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24
26 These functions return the hyperbolic cosine of x, which is defined
27 mathematically as:
28
29 cosh(x) = (exp(x) + exp(-x)) / 2
30
32 On success, these functions return the hyperbolic cosine of x.
33
34 If x is a NaN, a NaN is returned.
35
36 If x is +0 or -0, 1 is returned.
37
38 If x is positive infinity or negative infinity, positive infinity is
39 returned.
40
41 If the result overflows, a range error occurs, and the functions return
42 +HUGE_VAL, +HUGE_VALF, or +HUGE_VALL, respectively.
43
45 See math_error(7) for information on how to determine whether an error
46 has occurred when calling these functions.
47
48 The following errors can occur:
49
50 Range error: result overflow
51 errno is set to ERANGE. An overflow floating-point exception
52 (FE_OVERFLOW) is raised.
53
55 For an explanation of the terms used in this section, see at‐
56 tributes(7).
57
58 ┌────────────────────────────────────────────┬───────────────┬─────────┐
59 │Interface │ Attribute │ Value │
60 ├────────────────────────────────────────────┼───────────────┼─────────┤
61 │cosh(), coshf(), coshl() │ Thread safety │ MT-Safe │
62 └────────────────────────────────────────────┴───────────────┴─────────┘
63
65 C11, POSIX.1-2008.
66
68 C99, POSIX.1-2001.
69
70 The variant returning double also conforms to SVr4, 4.3BSD.
71
73 In glibc 2.3.4 and earlier, an overflow floating-point (FE_OVERFLOW)
74 exception is not raised when an overflow occurs.
75
77 acosh(3), asinh(3), atanh(3), ccos(3), sinh(3), tanh(3)
78
79
80
81Linux man-pages 6.04 2023-03-30 cosh(3)