Skip to content

Instantly share code, notes, and snippets.

@cyberkm
Created December 15, 2018 09:19
Show Gist options
  • Save cyberkm/4477b20acb38418a37e12f3eb7c5c21c to your computer and use it in GitHub Desktop.
Save cyberkm/4477b20acb38418a37e12f3eb7c5c21c to your computer and use it in GitHub Desktop.
Population count algorithm hack
x * 0x0101010101010101ull
is equal to (x + (x<<8) + (x<<16) + ... + (x<<56))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment