Re:Poll: How many programmers don't know about bit-wise oper...
by jcr on Sunday April 07, 2013 @06:38AM
(#5506747)
If you're into bit hacks...
Though K&R is on the shelf within reach and I knew it had
a good algorithm for counting set bits (ones), I also remembered
reading about a more efficient method a while back. The following
page covers a number of set bit counting hacks:
Though K&R is on the shelf within reach and I knew it had a good algorithm for counting set bits (ones), I also remembered reading about a more efficient method a while back. The following page covers a number of set bit counting hacks:
http://graphics.stanford.edu/~seander/bithacks.html