Purpose
Population parity
Determines
the parity for a data object.
Argument type and attributes
- I
- An INTENT(IN) INTEGER
- The argument can also be of type BYTE, LOGICAL,
or REAL. If the type of the argument is REAL,
it must not be REAL(16).
Result type and attributes
Default
integer
Result value
- Returns 1 if I includes an odd number of
bits set to 1.
- Returns 0 if I includes an even number of
bits set to 1.
Examples
The following table
shows the functionality of the POPPAR function.
Integer |
Bit Representation |
POPPAR |
0 |
0000 |
0 |
1 |
0001 |
1 |
2 |
0010 |
1 |
3 |
0011 |
0 |
4 |
0100 |
1 |