]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/fortran/doc/gfortran/intrinsic-procedures/aimag.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / aimag.rst
CommitLineData
c63539ff
ML
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.. _aimag:
7
8.. index:: AIMAG
9
10.. index:: DIMAG
11
12.. index:: IMAG
13
14.. index:: IMAGPART
15
16.. index:: complex numbers, imaginary part
17
18AIMAG --- Imaginary part of complex number
19********************************************
20
21.. function:: AIMAG(Z)
22
23 ``AIMAG(Z)`` yields the imaginary part of complex argument ``Z``.
24 The ``IMAG(Z)`` and ``IMAGPART(Z)`` intrinsic functions are provided
25 for compatibility with :command:`g77`, and their use in new code is
26 strongly discouraged.
27
28 :param Z:
29 The type of the argument shall be ``COMPLEX``.
30
31 :return:
32 The return value is of type ``REAL`` with the
33 kind type parameter of the argument.
34
35 Standard:
36 Fortran 77 and later, has overloads that are GNU extensions
37
38 Class:
39 Elemental function
40
41 Syntax:
42 .. code-block:: fortran
43
44 RESULT = AIMAG(Z)
45
46 Example:
47 .. code-block:: fortran
48
49 program test_aimag
50 complex(4) z4
51 complex(8) z8
52 z4 = cmplx(1.e0_4, 0.e0_4)
53 z8 = cmplx(0.e0_8, 1.e0_8)
54 print *, aimag(z4), dimag(z8)
55 end program test_aimag
56
57 Specific names:
58 .. list-table::
59 :header-rows: 1
60
61 * - Name
62 - Argument
63 - Return type
64 - Standard
65
66 * - ``AIMAG(Z)``
67 - ``COMPLEX Z``
68 - ``REAL``
69 - Fortran 77 and later
70 * - ``DIMAG(Z)``
71 - ``COMPLEX(8) Z``
72 - ``REAL(8)``
73 - GNU extension
74 * - ``IMAG(Z)``
75 - ``COMPLEX Z``
76 - ``REAL``
77 - GNU extension
78 * - ``IMAGPART(Z)``
79 - ``COMPLEX Z``
80 - ``REAL``
3ed1b4ce 81 - GNU extension