Question 20.12

What is the most efficient way to count the number of bits which are set in a value?


Many ``bit-fiddling'' problems like this one can be sped up and streamlined using lookup tables (but see question 20.13).


Read sequentially: prev next up top


This page by Steve Summit // Copyright 1995 // mail feedback