dim - (Optional) shall be a scalar of type integer with a value in the range from 1 to n, where n equals the rank of array.

Return value

The result is of the same type as mask.

If dim is absent, a scalar with the parity of all elements in mask is returned: .true. if an odd number of elements are .true. and .false. otherwise. If dim is present, an array of rank $n-1$, where $n$ equals the rank of mask, and a shape similar to that of mask with dimension dim dropped is returned.

Example

program test_paritylogical::x(2)=[.true.,.false.]print*,parity(x)! Tendprogram