Sha256: 35feb43767f59ea0240b4992b60dc074f25560320d0533ea61ad0e593f36e064
Contents?: true
Size: 260 Bytes
Versions: 10
Compression:
Stored size: 260 Bytes
Contents
unless Fixnum.method_defined? :bit_length require 'backports/2.0.0/range/bsearch' class Fixnum def bit_length n = if self >= 0 self + 1 else -self end (0...8 * size).bsearch{|i| n <= (1 << i) } end end end
Version data entries
10 entries across 10 versions & 2 rubygems