Author mark.dickinson
Recipients Jim Fasarakis-Hilliard, Mark.Shannon, casevh, gbtami, mark.dickinson, niklasf, njs, rhettinger, serhiy.storchaka, tim.peters, vstinner
Date 2020-05-31.13:46:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590932810.58.0.279430362113.issue29882@roundup.psfhosted.org>
In-reply-to
Content
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"?
History
Date User Action Args
2020-05-31 13:46:50mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, vstinner, casevh, njs, Mark.Shannon, serhiy.storchaka, Jim Fasarakis-Hilliard, niklasf, gbtami
2020-05-31 13:46:50mark.dickinsonsetmessageid: <1590932810.58.0.279430362113.issue29882@roundup.psfhosted.org>
2020-05-31 13:46:50mark.dickinsonlinkissue29882 messages
2020-05-31 13:46:49mark.dickinsoncreate