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 AND --- Bitwise logical AND
9 ***************************
11 .. index:: AND, bitwise logical and, logical and, bitwise
13 .. function:: AND(I, J)
15 Bitwise logical ``AND``.
18 The type shall be either a scalar ``INTEGER``
19 type or a scalar ``LOGICAL`` type or a boz-literal-constant.
22 The type shall be the same as the type of :samp:`{I}` or
23 a boz-literal-constant. :samp:`{I}` and :samp:`{J}` shall not both be
24 boz-literal-constants. If either :samp:`{I}` or :samp:`{J}` is a
25 boz-literal-constant, then the other argument must be a scalar ``INTEGER``.
28 The return type is either a scalar ``INTEGER`` or a scalar
29 ``LOGICAL``. If the kind type parameters differ, then the
30 smaller kind type is implicitly converted to larger kind, and the
31 return has the larger kind. A boz-literal-constant is
32 converted to an ``INTEGER`` with the kind type parameter of
33 the other argument as-if a call to :ref:`INT` occurred.
42 .. code-block:: fortran
47 .. code-block:: fortran
50 LOGICAL :: T = .TRUE., F = .FALSE.
52 DATA a / Z'F' /, b / Z'3' /
54 WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
59 Fortran 95 elemental function: