]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/fortran/doc/gfortran/intrinsic-procedures/iany.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / iany.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.. index:: IANY, array, OR, bits, OR of array elements
7
8.. _iany:
9
10IANY --- Bitwise OR of array elements
11*************************************
12
13.. function:: IANY(ARRAY, DIM, MASK)
14
15 Reduces with bitwise OR (inclusive or) the elements of :samp:`{ARRAY}` along
16 dimension :samp:`{DIM}` if the corresponding element in :samp:`{MASK}` is ``TRUE``.
17
18 :param ARRAY:
19 Shall be an array of type ``INTEGER``
20
21 :param DIM:
22 (Optional) shall be a scalar of type
23 ``INTEGER`` with a value in the range from 1 to n, where n
24 equals the rank of :samp:`{ARRAY}`.
25
26 :param MASK:
27 (Optional) shall be of type ``LOGICAL``
28 and either be a scalar or an array of the same shape as :samp:`{ARRAY}`.
29
30 :return:
31 The result is of the same type as :samp:`{ARRAY}`.
32
33 Standard:
34 Fortran 2008 and later
35
36 Class:
37 Transformational function
38
39 Syntax:
40 .. code-block:: fortran
41
42 RESULT = IANY(ARRAY[, MASK])
43 RESULT = IANY(ARRAY, DIM[, MASK])
44
45 Example:
46 .. code-block:: fortran
47
48 PROGRAM test_iany
49 INTEGER(1) :: a(2)
50
51 a(1) = b'00100100'
52 a(2) = b'01101010'
53
54 ! prints 01101110
55 PRINT '(b8.8)', IANY(a)
56 END PROGRAM
57
58 See also:
59 :ref:`IPARITY`,
60 :ref:`IALL`,
3ed1b4ce 61 :ref:`IOR`