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.
6 .. index:: PARITY, Parity, Reduction, XOR, XOR reduction
10 PARITY --- Reduction with exclusive OR
11 **************************************
13 .. function:: PARITY(MASK, DIM)
15 Calculates the parity, i.e. the reduction using ``.XOR.``,
16 of :samp:`{MASK}` along dimension :samp:`{DIM}`.
19 Shall be an array of type ``LOGICAL``
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:`{MASK}`.
27 The result is of the same type as :samp:`{MASK}`.
30 Fortran 2008 and later
33 Transformational function
36 .. code-block:: fortran
38 RESULT = PARITY(MASK[, DIM])
41 .. code-block:: fortran
44 LOGICAL :: x(2) = [ .true., .false. ]
45 print *, PARITY(x) ! prints "T" (true).