3 ms·
What's wrong with that? This is often a single CPU instruction and a lot of languages have support for it, including python https://en.m.wikipedia.org/wiki/Ham
by spencerflem 1y ago
What's wrong with that? This is often a single CPU instruction and a lot of languages have support for it, including python
https://en.m.wikipedia.org/wiki/Hamming_weight https://en.m.wikipedia.org/wiki/Hamming_weight
- wslh 1y agoIt was a positive comment about Swift showing the batteries included there. It is not normal to have such high-level methods for low-level stuff like bits in an integer. Clearly logical operations and rotation is included in all popular languages.
- spencerflem 1y agoPython has bit_count() as of semi recently :) But I gotcha now, mistook "I wonder" as "I suspect it's not"