next up previous contents
Next: POPPAR(I) Up: Specifications of Library Procedures Previous: POPCNT(I)

POPCNT(I)

Description. Return the number of one bits in an integer.

Class. Elemental function.

Argument. I must be of type integer.

Result Type and Type Parameter. Same as I.

Result Value. POPCNT(I) is the number of one bits in the binary representation of the integer I. The model for the interpretation of an integer as a sequence of bits is in Section F95:13.5.7

Example. POPCNT(I) = COUNT((/ (BTEST(I,J), J=0, BIT_SIZE(I)-1) /)), for scalar I.