]> gcc.gnu.org Git - gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/log.rst
sphinx: copy files from texi2rst-generated repository
[gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / log.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 .. _log:
7
8 .. index:: LOG
9
10 .. index:: ALOG
11
12 .. index:: DLOG
13
14 .. index:: CLOG
15
16 .. index:: ZLOG
17
18 .. index:: CDLOG
19
20 .. index:: exponential function, inverse
21
22 .. index:: logarithm function
23
24 .. index:: natural logarithm function
25
26 LOG --- Natural logarithm function
27 **********************************
28
29 .. function:: LOG(X)
30
31 ``LOG(X)`` computes the natural logarithm of :samp:`{X}`, i.e. the
32 logarithm to the base e.
33
34 :param X:
35 The type shall be ``REAL`` or
36 ``COMPLEX``.
37
38 :return:
39 The return value is of type ``REAL`` or ``COMPLEX``.
40 The kind type parameter is the same as :samp:`{X}`.
41 If :samp:`{X}` is ``COMPLEX``, the imaginary part \omega is in the range
42 -\pi < \omega \leq \pi.
43
44 Standard:
45 Fortran 77 and later, has GNU extensions
46
47 Class:
48 Elemental function
49
50 Syntax:
51 .. code-block:: fortran
52
53 RESULT = LOG(X)
54
55 Example:
56 .. code-block:: fortran
57
58 program test_log
59 real(8) :: x = 2.7182818284590451_8
60 complex :: z = (1.0, 2.0)
61 x = log(x) ! will yield (approximately) 1
62 z = log(z)
63 end program test_log
64
65 Specific names:
66 .. list-table::
67 :header-rows: 1
68
69 * - Name
70 - Argument
71 - Return type
72 - Standard
73
74 * - ``ALOG(X)``
75 - ``REAL(4) X``
76 - ``REAL(4)``
77 - Fortran 77 or later
78 * - ``DLOG(X)``
79 - ``REAL(8) X``
80 - ``REAL(8)``
81 - Fortran 77 or later
82 * - ``CLOG(X)``
83 - ``COMPLEX(4) X``
84 - ``COMPLEX(4)``
85 - Fortran 77 or later
86 * - ``ZLOG(X)``
87 - ``COMPLEX(8) X``
88 - ``COMPLEX(8)``
89 - GNU extension
90 * - ``CDLOG(X)``
91 - ``COMPLEX(8) X``
92 - ``COMPLEX(8)``
93 - GNU extension
This page took 0.038752 seconds and 5 git commands to generate.