]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
3c0484a7 MK |
2 | .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk |
3 | .\" <mtk.manpages@gmail.com> | |
fea681da | 4 | .\" |
5fbde956 | 5 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
6 | .\" |
7 | .\" References consulted: | |
8 | .\" Linux libc source code | |
9 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
10 | .\" 386BSD man pages | |
11 | .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) | |
12 | .\" Modified 2002-07-27 by Walter Harms | |
13 | .\" (walter.harms@informatik.uni-oldenburg.de) | |
14 | .\" | |
1ae6b2c7 | 15 | .TH TANH 3 2021-03-22 GNU "Linux Programmer's Manual" |
fea681da MK |
16 | .SH NAME |
17 | tanh, tanhf, tanhl \- hyperbolic tangent function | |
e2834964 AC |
18 | .SH LIBRARY |
19 | Math library | |
8fc3b2cf | 20 | .RI ( libm ", " \-lm ) |
fea681da MK |
21 | .SH SYNOPSIS |
22 | .nf | |
23 | .B #include <math.h> | |
68e4db0a | 24 | .PP |
fea681da | 25 | .BI "double tanh(double " x ); |
fea681da | 26 | .BI "float tanhf(float " x ); |
fea681da MK |
27 | .BI "long double tanhl(long double " x ); |
28 | .fi | |
68e4db0a | 29 | .PP |
d39ad78f | 30 | .RS -4 |
3c0484a7 MK |
31 | Feature Test Macro Requirements for glibc (see |
32 | .BR feature_test_macros (7)): | |
d39ad78f | 33 | .RE |
68e4db0a | 34 | .PP |
3c0484a7 MK |
35 | .BR tanhf (), |
36 | .BR tanhl (): | |
9d2adbae | 37 | .nf |
5c10d2c5 | 38 | _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L |
9d2adbae MK |
39 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE |
40 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
41 | .fi | |
fea681da | 42 | .SH DESCRIPTION |
5600f73a | 43 | These functions return the hyperbolic tangent of |
022671eb MK |
44 | .IR x , |
45 | which | |
658670de | 46 | is defined mathematically as: |
a2b7a144 | 47 | .PP |
658670de | 48 | .nf |
658670de | 49 | tanh(x) = sinh(x) / cosh(x) |
494fc522 | 50 | .fi |
47297adb | 51 | .SH RETURN VALUE |
3c0484a7 MK |
52 | On success, these functions return the hyperbolic tangent of |
53 | .IR x . | |
847e0d88 | 54 | .PP |
3c0484a7 MK |
55 | If |
56 | .I x | |
57 | is a NaN, a NaN is returned. | |
847e0d88 | 58 | .PP |
3c0484a7 MK |
59 | If |
60 | .I x | |
61 | is +0 (\-0), +0 (\-0) is returned. | |
847e0d88 | 62 | .PP |
3c0484a7 MK |
63 | If |
64 | .I x | |
65 | is positive infinity (negative infinity), | |
66 | +1 (\-1) is returned. | |
67 | .\" | |
385cf745 | 68 | .\" POSIX.1-2001 documents an optional range error (underflow) |
3c0484a7 MK |
69 | .\" for subnormal x; |
70 | .\" glibc 2.8 does not do this. | |
71 | .SH ERRORS | |
72 | No errors occur. | |
38d62724 | 73 | .SH ATTRIBUTES |
f4ededc1 PH |
74 | For an explanation of the terms used in this section, see |
75 | .BR attributes (7). | |
c466875e MK |
76 | .ad l |
77 | .nh | |
f4ededc1 PH |
78 | .TS |
79 | allbox; | |
c466875e | 80 | lbx lb lb |
f4ededc1 PH |
81 | l l l. |
82 | Interface Attribute Value | |
83 | T{ | |
38d62724 PH |
84 | .BR tanh (), |
85 | .BR tanhf (), | |
38d62724 | 86 | .BR tanhl () |
f4ededc1 PH |
87 | T} Thread safety MT-Safe |
88 | .TE | |
c466875e MK |
89 | .hy |
90 | .ad | |
91 | .sp 1 | |
47297adb | 92 | .SH CONFORMING TO |
9a74e018 | 93 | C99, POSIX.1-2001, POSIX.1-2008. |
847e0d88 | 94 | .PP |
3c0484a7 MK |
95 | The variant returning |
96 | .I double | |
97 | also conforms to | |
68e1685c | 98 | SVr4, 4.3BSD, C89. |
47297adb | 99 | .SH SEE ALSO |
fea681da MK |
100 | .BR acosh (3), |
101 | .BR asinh (3), | |
102 | .BR atanh (3), | |
103 | .BR cosh (3), | |
36268806 | 104 | .BR ctanh (3), |
fea681da | 105 | .BR sinh (3) |