Count number of bits in a 64-bit (long, big) integer?

Posted by Jeff Meatball Yang on Stack Overflow See other posts from Stack Overflow or by Jeff Meatball Yang
Published on 2010-04-25T18:46:47Z Indexed on 2010/04/25 18:53 UTC
Read the original article Hit count: 181

Filed under:
|

I have read through this SO question about 32-bits, but what about 64-bit numbers? Should I just mask the upper and lower 4 bytes, perform the count on the 32-bits and then add them together?

© Stack Overflow or respective owner

Related posts about bit-manipulation

Related posts about 64bit