System.Xml.Bits.LeastPosition C# (CSharp) Méthode

LeastPosition() public static méthode

Compute the 1-based position of the least sigificant bit that is set, and return it (return 0 if no bits are set). (e.g. 0x1001100 will return 3, since the 3rd bit is set).
public static LeastPosition ( uint num ) : int
num uint
Résultat int
        public static int LeastPosition(uint num) {
            if (num == 0) return 0;
            return Count(num ^ (num - 1));
        }
    }