Sha256: ff97fa22be91529ef25150e8672d4529f89ce458476d700386c2a0e184272f43

Contents?: true

Size: 230 Bytes

Versions: 7

Compression:

Stored size: 230 Bytes

Contents

# -*- coding: utf-8 -*-


module Xot


  module BitUtil

    module_function

    def bit (*bits)
      return nil if bits.compact.empty?
      bits.reduce(0) {|value, nth| value | (0x1 << nth)}
    end

  end# BitUtil


end# Xot

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
xot-0.1.21 lib/xot/bit_util.rb
xot-0.1.20 lib/xot/bit_util.rb
xot-0.1.19 lib/xot/bit_util.rb
xot-0.1.16 lib/xot/bit_util.rb
xot-0.1.15 lib/xot/bit_util.rb
xot-0.1.14 lib/xot/bit_util.rb
xot-0.1.13 lib/xot/bit_util.rb