Documentation ¶
Overview ¶
The expression `x&(x-1)` clears the rightmost non-zero bit of x. Write a version of `PopCount` that counts bits by using this fact, and assess its performance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByClearing ¶
ByClearing returns the population count (number of set bits) of x by clearing.
func ByShifting ¶
ByShifting returns the population count (number of set bits) of x by shifting.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.