function BitOps.numOfSetBits(G)local r=0 while G~=0 do G=bit32.band(G,G-1)r=r+1 end return r end return BitOps

function BitOps.numOfSetBits(int)
	local count = 0
	while int ~= 0 do
		int = bit32.band(int, int - 1)
		count = count + 1
	end

	return count
end

return BitOps
