Mark Dickinson <dicki...@gmail.com> added the comment:

A couple of other data points:

- Swift has nonzeroBitCount: 
https://developer.apple.com/documentation/swift/int/2886050-nonzerobitcount

- Rust has count_ones: https://doc.rust-lang.org/std/primitive.u64.html

- Go's math/bits package has OnesCount

- The closest thing in Mathematica appears to be DigitCount, which isn't 
base-specific.

@Mark Shannon: what name would you suggest, and why? The term "population 
count" feels too non-obvious and specialist to me, and anything involving 
"Hamming" likewise.

"count_ones" isn't obviously a bit operation.

"count_set_bits"?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue29882>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to