News for hackers. Stuff that matters.
Re:The beauty of bitwise AND by Strilanc on Sunday August 07, 2016 @04:07PM (#12243417)
Seems to work fine for -1:

    f(-1, -1)
    = sum_{n=0}^b 2^n (floor(-1/2^n) mod 2) (floor(-1/2^n) mod 2)
    = sum_{n=0}^b 2^n * 1 * 1
    = 1 + 10 + 100 + 1000 + ... [in binary]
    = ...11111 [in the 2-adics]
    = -1

There are no comments on this comment yet.