1tanh(3) Library Functions Manual tanh(3)
2
3
4
6 tanh, tanhf, tanhl - hyperbolic tangent function
7
9 Math library (libm, -lm)
10
12 #include <math.h>
13
14 double tanh(double x);
15 float tanhf(float x);
16 long double tanhl(long double x);
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 tanhf(), tanhl():
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 tangent of x, which is defined
27 mathematically as:
28
29 tanh(x) = sinh(x) / cosh(x)
30
32 On success, these functions return the hyperbolic tangent of x.
33
34 If x is a NaN, a NaN is returned.
35
36 If x is +0 (-0), +0 (-0) is returned.
37
38 If x is positive infinity (negative infinity), +1 (-1) is returned.
39
41 No errors occur.
42
44 For an explanation of the terms used in this section, see at‐
45 tributes(7).
46
47 ┌────────────────────────────────────────────┬───────────────┬─────────┐
48 │Interface │ Attribute │ Value │
49 ├────────────────────────────────────────────┼───────────────┼─────────┤
50 │tanh(), tanhf(), tanhl() │ Thread safety │ MT-Safe │
51 └────────────────────────────────────────────┴───────────────┴─────────┘
52
54 C11, POSIX.1-2008.
55
57 C99, POSIX.1-2001.
58
59 The variant returning double also conforms to SVr4, 4.3BSD, C89.
60
62 acosh(3), asinh(3), atanh(3), cosh(3), ctanh(3), sinh(3)
63
64
65
66Linux man-pages 6.04 2023-03-30 tanh(3)