RosettaCodeData/Task/Population-count/Go/population-count-3.go

8 lines
98 B
Go

func pop64(w uint64) (c int) {
for w != 0 {
w &= w - 1
c++
}
return
}