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.
8 ALL --- All values in MASK along DIM are true
9 **********************************************
11 .. index:: ALL, array, apply condition, array, condition testing
13 .. function:: ALL(MASK, DIM)
15 ``ALL(MASK [, DIM])`` determines if all the values are true in :samp:`{MASK}`
16 in the array along dimension :samp:`{DIM}`.
19 The type of the argument shall be ``LOGICAL`` and
20 it shall not be scalar.
23 (Optional) :samp:`{DIM}` shall be a scalar integer
24 with a value that lies between one and the rank of :samp:`{MASK}`.
27 ``ALL(MASK)`` returns a scalar value of type ``LOGICAL`` where
28 the kind type parameter is the same as the kind type parameter of
29 :samp:`{MASK}`. If :samp:`{DIM}` is present, then ``ALL(MASK, DIM)`` returns
30 an array with the rank of :samp:`{MASK}` minus 1. The shape is determined from
31 the shape of :samp:`{MASK}` where the :samp:`{DIM}` dimension is elided.
37 Transformational function
40 .. code-block:: fortran
42 RESULT = ALL(MASK [, DIM])
45 .. code-block:: fortran
49 l = all((/.true., .true., .true./))
54 integer a(2,3), b(2,3)
58 print *, all(a .eq. b, 1)
59 print *, all(a .eq. b, 2)
60 end subroutine section