next up previous index
Next: M431 Convert Between Up: CERNLIB Previous: M428 Search for

M429 Number of One-Bits in a Word

Routine ID: M429
Author(s): M. MetcalfLibrary: KERNLIB
Submitter: Submitted: 01.06.1973
Language: AssemblerRevised: 15.09.1978

NUMBIT counts the one-bits in a word.

Structure:

FUNCTION subprogram
User Entry Names: NUMBIT

Usage:

In an arithmetic expression, NUMBIT(X)

has the INTEGER value giving the number of one-bits in X.

Examples:

    J=NUMBIT(5)
sets J to 2 as the binary representation of 5 has 2 one-bits.

M431


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995