Sha256: 7f1f222f62654a8ca6cf47edb1aecf2104a45d218788dfbb2052836b3651d68a
Contents?: true
Size: 353 Bytes
Versions: 27
Compression:
Stored size: 353 Bytes
Contents
module Lrama module Bitmap def self.from_array(ary) bit = 0 ary.each do |int| bit |= (1 << int) end bit end def self.to_array(int) a = [] i = 0 while int > 0 do if int & 1 == 1 a << i end i += 1 int >>= 1 end a end end end
Version data entries
27 entries across 27 versions & 1 rubygems