4 ms·
`bit_count` is a terrible name for a function that returns the number of one-bits. Zero-bits are bits too!
by pansa2 4y ago
`bit_count` is a terrible name for a function that returns the number of one-bits. Zero-bits are bits too!
- danwills 4y agoYeah, good point! I hadn't thought about that until you mentioned it but totally agree. I'd suggest something like `num_enabled_bits` or `enabled_bits_count` might have made things a bit clearer?
- carapace 4y agoThe operation's name is "popcount", there's an asm (i86?) instruction "POPCNT". https://duckduckgo.com/?t=ffcm&q=popcount&ia=web https://duckduckgo.com/?t=ffcm&q=popcount&ia=web