Site Tools


documentation:development:opera:pf25:ppgfldr:pgsfldr:spr:01spr019

CountBits

Counts the number of bits set in a word.

Synopsis

int CountBits(uint32 mask);

Description

CountBits examines the longword passed in as a parameter and returns the number of bits that are turned on in the word, using an algorithm derived from a note in MIT's HAKMEM.

Arguments

  • mask The data word to count the bits of.

Return Value

The number of bits that were turned on in the supplied value.

Implementation

Convenience call implemented in clib.lib V21.

Associated Files

  • string.h ANSI C Prototype
  • clib.lib ARM Link library

See Also

FindMSB(), FindLSB()


documentation/development/opera/pf25/ppgfldr/pgsfldr/spr/01spr019.txt · Last modified: 2022/10/10 16:53 by 127.0.0.1