News for hackers. Stuff that matters.
Re:Counting set bits in an interesting way by a_e_k on Saturday April 30, 2022 @01:46PM (#31217754)
Right. And the reason that zeroes out the least significant bit is because subtracting one just borrows up to it. E.g., for n = 464:

    n       = 464d 111010000b
    n-1     = 463d 111001111b
    n&(n-1) = 448d 111000000b

There are no comments on this comment yet.