A bit manipulation readability enhancement library.
Counts the bits that are set to 1 in a number.
public static int CountBitsSet(this sbyte number);
number
System.SByte
The number to evaluate.
System.Int32 The count of the bits set to 1.
var v = sbyte.MaxValue;
Console.WriteLine($"{v.CountBitsSet()} bits are set."); // outputs: 7 bits are set.
This is a reader-friendly alias for PopCount(this sbyte).