]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/tanh.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / tanh.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. _tanh:
7
8 .. index:: TANH
9
10 .. index:: DTANH
11
12 .. index:: hyperbolic tangent
13
14 .. index:: hyperbolic function, tangent
15
16 .. index:: tangent, hyperbolic
17
18 TANH --- Hyperbolic tangent function
19 *************************************
20
21 .. function:: TANH(X)
22
23 ``TANH(X)`` computes the hyperbolic tangent of :samp:`{X}`.
24
25 :param X:
26 The type shall be ``REAL`` or ``COMPLEX``.
27
28 :return:
29 The return value has same type and kind as :samp:`{X}`. If :samp:`{X}` is
30 complex, the imaginary part of the result is in radians. If :samp:`{X}`
31 is ``REAL``, the return value lies in the range
32 - 1 \leq tanh(x) \leq 1 .
33
34 Standard:
35 Fortran 77 and later, for a complex argument Fortran 2008 or later
36
37 Class:
38 Elemental function
39
40 Syntax:
41 .. code-block:: fortran
42
43 X = TANH(X)
44
45 Example:
46 .. code-block:: fortran
47
48 program test_tanh
49 real(8) :: x = 2.1_8
50 x = tanh(x)
51 end program test_tanh
52
53 Specific names:
54 .. list-table::
55 :header-rows: 1
56
57 * - Name
58 - Argument
59 - Return type
60 - Standard
61
62 * - ``TANH(X)``
63 - ``REAL(4) X``
64 - ``REAL(4)``
65 - Fortran 77 and later
66 * - ``DTANH(X)``
67 - ``REAL(8) X``
68 - ``REAL(8)``
69 - Fortran 77 and later
70
71 See also:
72 :ref:`ATANH`