]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/max.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / max.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 .. _max:
7
8 .. index:: MAX
9
10 .. index:: MAX0
11
12 .. index:: AMAX0
13
14 .. index:: MAX1
15
16 .. index:: AMAX1
17
18 .. index:: DMAX1
19
20 .. index:: maximum value
21
22 MAX --- Maximum value of an argument list
23 *****************************************
24
25 .. function:: MAX(A1, A2 , A3 , ...)
26
27 Returns the argument with the largest (most positive) value.
28
29 :param A1:
30 The type shall be ``INTEGER`` or
31 ``REAL``.
32
33 :param A2}, {A3}, ...:
34 An expression of the same type and kind
35 as :samp:`{A1}`. (As a GNU extension, arguments of different kinds are
36 permitted.)
37
38 :return:
39 The return value corresponds to the maximum value among the arguments,
40 and has the same type and kind as the first argument.
41
42 Standard:
43 Fortran 77 and later
44
45 Class:
46 Elemental function
47
48 Syntax:
49 .. code-block:: fortran
50
51 RESULT = MAX(A1, A2 [, A3 [, ...]])
52
53 Specific names:
54 .. list-table::
55 :header-rows: 1
56
57 * - Name
58 - Argument
59 - Return type
60 - Standard
61
62 * - ``MAX0(A1)``
63 - ``INTEGER(4) A1``
64 - ``INTEGER(4)``
65 - Fortran 77 and later
66 * - ``AMAX0(A1)``
67 - ``INTEGER(4) A1``
68 - ``REAL(MAX(X))``
69 - Fortran 77 and later
70 * - ``MAX1(A1)``
71 - ``REAL A1``
72 - ``INT(MAX(X))``
73 - Fortran 77 and later
74 * - ``AMAX1(A1)``
75 - ``REAL(4) A1``
76 - ``REAL(4)``
77 - Fortran 77 and later
78 * - ``DMAX1(A1)``
79 - ``REAL(8) A1``
80 - ``REAL(8)``
81 - Fortran 77 and later
82
83 See also:
84 :ref:`MAXLOC`
85 :ref:`MAXVAL`,
86 :ref:`MIN`