Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference
A newer version of this document is available. Customers should click here to go to the newest version.
Visible to Intel only — GUID: GUID-F81B3DB3-7D20-4265-870D-35BC2F603AFB
Visible to Intel only — GUID: GUID-F81B3DB3-7D20-4265-870D-35BC2F603AFB
POPCNT
Elemental Intrinsic Function (Generic): Returns the number of 1 bits in the integer argument.
result = POPCNT (i)
i |
(Input) Must be of type integer or logical. |
Results
The result type and kind are the same as i. The result value is the number of 1 bits in the binary representation of the integer i.
The model for the interpretation of an integer value as a sequence of bits is shown in Model for Bit Data.
Example
If the value of I is B'0...00011010110', the value of POPCNT(I) is 5.