]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/iand.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / iand.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 .. _iand:
7
8 .. index:: IAND
9
10 .. index:: BIAND
11
12 .. index:: IIAND
13
14 .. index:: JIAND
15
16 .. index:: KIAND
17
18 .. index:: bitwise logical and
19
20 .. index:: logical and, bitwise
21
22 IAND --- Bitwise logical and
23 ****************************
24
25 .. function:: IAND(I, J)
26
27 Bitwise logical ``AND``.
28
29 :param I:
30 The type shall be ``INTEGER`` or a boz-literal-constant.
31
32 :param J:
33 The type shall be ``INTEGER`` with the same
34 kind type parameter as :samp:`{I}` or a boz-literal-constant.
35 :samp:`{I}` and :samp:`{J}` shall not both be boz-literal-constants.
36
37 :return:
38 The return type is ``INTEGER`` with the kind type parameter of the
39 arguments.
40 A boz-literal-constant is converted to an ``INTEGER`` with the kind
41 type parameter of the other argument as-if a call to :ref:`INT` occurred.
42
43 Standard:
44 Fortran 90 and later, with boz-literal-constant Fortran 2008 and later, has overloads that are GNU extensions
45
46 Class:
47 Elemental function
48
49 Syntax:
50 .. code-block:: fortran
51
52 RESULT = IAND(I, J)
53
54 Example:
55 .. code-block:: fortran
56
57 PROGRAM test_iand
58 INTEGER :: a, b
59 DATA a / Z'F' /, b / Z'3' /
60 WRITE (*,*) IAND(a, b)
61 END PROGRAM
62
63 Specific names:
64 .. list-table::
65 :header-rows: 1
66
67 * - Name
68 - Argument
69 - Return type
70 - Standard
71
72 * - ``IAND(A)``
73 - ``INTEGER A``
74 - ``INTEGER``
75 - Fortran 90 and later
76 * - ``BIAND(A)``
77 - ``INTEGER(1) A``
78 - ``INTEGER(1)``
79 - GNU extension
80 * - ``IIAND(A)``
81 - ``INTEGER(2) A``
82 - ``INTEGER(2)``
83 - GNU extension
84 * - ``JIAND(A)``
85 - ``INTEGER(4) A``
86 - ``INTEGER(4)``
87 - GNU extension
88 * - ``KIAND(A)``
89 - ``INTEGER(8) A``
90 - ``INTEGER(8)``
91 - GNU extension
92
93 See also:
94 :ref:`IOR`,
95 :ref:`IEOR`,
96 :ref:`IBITS`,
97 :ref:`IBSET`,
98 :ref:`IBCLR`,
99 :ref:`NOT`