InertiaM
Well-known member
Is there a simple way to count the number of bits used to make up an integer value? For example
I know I can do it with a FOR..NEXT loop and check the individual bits, but I just wondered if there was a function that I dont know about.
VB.NET:
dim iValue as integer = 1746 ' => 11011010001
dim iBitCount as integer = BitCount (iValue) ' should be 6
I know I can do it with a FOR..NEXT loop and check the individual bits, but I just wondered if there was a function that I dont know about.