RosettaCodeData/Task/Population-count/Go/population-count-3.go
2023-07-01 13:44:08 -04:00

7 lines
98 B
Go

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