Gemstone Common Library
Show/Hide TOC

# BitMathCountLeadingOnes(UInt32) Method

Counts the number of consecutive 1's starting from the highest bit working down.

## Definition

Namespace: Gemstone
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.158 -- Release Build+8af53c44e6ad1fac543a652d58b46c9843b74b64
C#
View Source Request Example

    public static int CountLeadingOnes(
    	uint value
    )

VB
View Source Request Example

    Public Shared Function CountLeadingOnes (
    	value As UInteger
    ) As Integer

C++
View Source Request Example

    public:
    static int CountLeadingOnes(
    	unsigned int value
    )

JavaScript
View Source Request Example

    Gemstone.BitMath.CountLeadingOnes = function(value);

#### Parameters

value UInt32
  Target value for bit counting.

#### Return Value

Int32
Number of consecutive 1's starting from the highest bit working down.

## See Also

#### Reference

BitMath Class
CountLeadingOnes Overload
Gemstone Namespace