what the hell was I thinking when I wrote this
This commit is contained in:
@ -191,7 +191,8 @@ end
|
|||||||
function ones(n)
|
function ones(n)
|
||||||
local ret = 0
|
local ret = 0
|
||||||
while n != 0 do
|
while n != 0 do
|
||||||
ret += 1
|
if (n&0x0.0001) ret += 1
|
||||||
|
n >>= 1
|
||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user