Message77911
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) |
|
Date |
User |
Action |
Args |
2008-12-16 14:11:06 | fredrikj | set | recipients:
+ fredrikj, loewis, rhettinger, terry.reedy, mark.dickinson, pitrou, vstinner |
2008-12-16 14:11:06 | fredrikj | set | messageid: <1229436666.56.0.0404393463889.issue3439@psf.upfronthosting.co.za> |
2008-12-16 14:11:06 | fredrikj | link | issue3439 messages |
2008-12-16 14:11:05 | fredrikj | create | |
|