def equal_to_numbers(field_values = {})
      fields = {}
      
      field_values.each_pair do |field_name, v|
        bits = self.bits_for(field_name)
        fields[bits] = v if bits.length > 0
      end
      
      all_num = 0
      none_num = 0
      fields.each_pair { |field_bits, val|
        field_bits.each_with_index do |bit, i|
          if @options[:bool_caster].call(val[i])
            all_num |= (1 << bit)
          else
            none_num |= (1 << bit)
          end
        end
      }
      
      [all_num, none_num]
    end
def equal_to_numbers(field_values = {})
      fields = {}
      
      field_values.each_pair do |field_name, v|
        bits = self.bits_for(field_name)
        fields[bits] = v if bits.length > 0
      end
      
      all_num = 0
      none_num = 0
      fields.each_pair { |field_bits, val|
        field_bits.each_with_index do |bit, i|
          if @options[:bool_caster].call(val[i])
            all_num |= (1 << bit)
          else
            none_num |= (1 << bit)
          end
        end
      }
      
      [all_num, none_num]
    end
Will return an array of two numbers, the first of which has all bits set
 where the corresponding value bit is 1, and the second has all bits set
 where the corresponding value bit is 0.
 These numbers can be used in advanced bitwise operations to test fields
 for exact equality.

 @param [Hash] one or more field names or an integer for a known bit index
   as the key, and the value (integer or boolean) for that field as the hash
   value. Values that have more bits than available will be truncated for
   comparison. eg. a field with one bit setting value to 2 means field is 0

 @example Retrieve the representation for various amounts
   gen = BitsGenerator.new(:is_odd => 0, :amount => [1, 2, 3], :is_cool => 4)
   gen.equal_to_numbers(:amount => 5) #=> [10, 4]
   # 5 is 101, 10 is 1010 and 4 is 100. (Note that amount uses bits 1, 2, 3)
   gen.equal_to_numbers(:amount => 7) #=> [14, 0]
   gen.equal_to_numbers(:amount => 7, :is_odd => 1) #=> [15, 0]


 @return [Array<Integer>] an array of two integers, first representing bits
   of given field bit values as 1 set to 1, and the second representing bits
   of given field bit values as 0 set to 1. See the example.