+-------------------------------IBM Extension--------------------------------+

POPPAR(I)

Purpose

Population parity.

Determines the parity for a data object.

Class

Elemental function.

Argument Type and Attributes

I
An INTENT(IN) argument of type BYTE, INTEGER, LOGICAL, or REAL. If the argument is of type REAL, it must not be REAL(16).

Result Type and Attributes

Default integer.

Result Value

Returns 1 if there are an odd number of bits set.

Returns 0 if there are an even number of bits set.

Examples


INTEGER BIT REPRESENTATION POPPAR
0 0000 0
1 0001 1
2 0010 1
3 0011 0
4 0100 1

Related Information

Data Representation Models

+----------------------------End of IBM Extension----------------------------+

IBM Copyright 2003