Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> What are the users for popcount?

https://en.wikipedia.org/wiki/Hamming_distance#History_and_a...

EDIT: What might not have been obvious is that popcount combines with other operations well. E.g. popcount(A ^ B) gives the number of bits that differ. popcount(A & B) gives the number of bits that are the same. popcount(A) gives the number of options set in a flag field. etc., etc.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: