]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/minval.rst
sphinx: copy files from texi2rst-generated repository
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / minval.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 .. index:: MINVAL, array, minimum value, minimum value
7
8 .. _minval:
9
10 MINVAL --- Minimum value of an array
11 ************************************
12
13 .. function:: MINVAL(ARRAY , MASK)
14
15 Determines the minimum value of the elements in an array value, or, if
16 the :samp:`{DIM}` argument is supplied, determines the minimum value along
17 each row of the array in the :samp:`{DIM}` direction. If :samp:`{MASK}` is
18 present, only the elements for which :samp:`{MASK}` is ``.TRUE.`` are
19 considered. If the array has zero size, or all of the elements of
20 :samp:`{MASK}` are ``.FALSE.``, then the result is ``HUGE(ARRAY)`` if
21 :samp:`{ARRAY}` is numeric, or a string of ``CHAR(255)`` characters if
22 :samp:`{ARRAY}` is of character type.
23
24 :param ARRAY:
25 Shall be an array of type ``INTEGER`` or
26 ``REAL``.
27
28 :param DIM:
29 (Optional) Shall be a scalar of type
30 ``INTEGER``, with a value between one and the rank of :samp:`{ARRAY}`,
31 inclusive. It may not be an optional dummy argument.
32
33 :param MASK:
34 Shall be of type ``LOGICAL``,
35 and conformable with :samp:`{ARRAY}`.
36
37 :return:
38 If :samp:`{DIM}` is absent, or if :samp:`{ARRAY}` has a rank of one, the result
39 is a scalar. If :samp:`{DIM}` is present, the result is an array with a
40 rank one less than the rank of :samp:`{ARRAY}`, and a size corresponding to
41 the size of :samp:`{ARRAY}` with the :samp:`{DIM}` dimension removed. In all
42 cases, the result is of the same type and kind as :samp:`{ARRAY}`.
43
44 Standard:
45 Fortran 90 and later
46
47 Class:
48 Transformational function
49
50 Syntax:
51 .. code-block:: fortran
52
53 RESULT = MINVAL(ARRAY, DIM [, MASK])
54 RESULT = MINVAL(ARRAY [, MASK])
55
56 See also:
57 :ref:`MIN`,
58 :ref:`MINLOC`