counting matching bits / bitXnor

Cees de Groot cdegroot at gmail.com
Tue Dec 18 10:15:23 UTC 2007


I typed 'counting bits' on Google and found the excellent page
http://graphics.stanford.edu/~seander/bithacks.html

Nice to see that a trivial space/time trade-off works soo much better
than funky algorithms, by the way :)

On Dec 17, 2007 6:37 PM, Matthew Fulmer <tapplek at gmail.com> wrote:
> doing a google search for "fast bit counting" brings up
> http://infolab.stanford.edu/~manku/bitcount/bitcount.html as the
> first hit. The first algorithm listed takes time proportional to
> the number of 1 bits in the integer, rather than the length of
> the bit encoding. It relies on the ability to do a fast zero
> check, though, as the loop exit condition
>
> --
> Matthew Fulmer -- http://mtfulmer.wordpress.com/
> Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808
>
>



-- 
"Human beings make life so interesting. Do you know, that in a
universe so full of wonders, they have managed to invent boredom. " -
Death, in "The Hogfather"



More information about the Squeak-dev mailing list