This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fredrikj
Recipients fredrikj, loewis, mark.dickinson, pitrou, rhettinger, terry.reedy, vstinner
Date 2008-12-16.14:11:05
SpamBayes Score 0.0006448789
Marked as misclassified No
Message-id <1229436666.56.0.0404393463889.issue3439@psf.upfronthosting.co.za>
In-reply-to
Content
When did the name change back to numbits? Anyway, I think this reference
implementation is better:

def numbits(x):
    x = abs(x)
    n = 0
    while x:
        n += 1
        x //= 2
    return n

(//= 2 could be changed to >>= 1)
History
Date User Action Args
2008-12-16 14:11:06fredrikjsetrecipients: + fredrikj, loewis, rhettinger, terry.reedy, mark.dickinson, pitrou, vstinner
2008-12-16 14:11:06fredrikjsetmessageid: <1229436666.56.0.0404393463889.issue3439@psf.upfronthosting.co.za>
2008-12-16 14:11:06fredrikjlinkissue3439 messages
2008-12-16 14:11:05fredrikjcreate