NBit Bit Manipulation Library

BitMathExtensions.CountBits Method

Counts the number of one bits in a value.

[Visual Basic]
<Extension> _
Public Shared Sub CountBits( _
   ByVal value As UInt32 _
)
[C#]
[Extension]
public static int CountBits(
   this uint value
);

Parameters

value
The value to count the bits of.

Return Value

The number of one bits.

See Also

BitMathExtensions Class | NBit Namespace