def to_base
      return self if base?
      if @@unit_map[units] =~ /\A<(?:temp|deg)[CRF]>\Z/
        @signature = @@kinds.key(:temperature)
        base = if temperature?
                 convert_to('tempK')
               elsif degree?
                 convert_to('degK')
               end
        return base
      end

      cached = (begin
                  (@@base_unit_cache[units] * scalar)
                rescue
                  nil
                end)
      return cached if cached

      num = []
      den = []
      q   = Rational(1)
      @numerator.compact.each do |num_unit|
        if @@prefix_values[num_unit]
          q *= @@prefix_values[num_unit]
        else
          q *= @@unit_values[num_unit][:scalar] if @@unit_values[num_unit]
          num << @@unit_values[num_unit][:numerator] if @@unit_values[num_unit] && @@unit_values[num_unit][:numerator]
          den << @@unit_values[num_unit][:denominator] if @@unit_values[num_unit] && @@unit_values[num_unit][:denominator]
        end
      end
      @denominator.compact.each do |num_unit|
        if @@prefix_values[num_unit]
          q /= @@prefix_values[num_unit]
        else
          q /= @@unit_values[num_unit][:scalar] if @@unit_values[num_unit]
          den << @@unit_values[num_unit][:numerator] if @@unit_values[num_unit] && @@unit_values[num_unit][:numerator]
          num << @@unit_values[num_unit][:denominator] if @@unit_values[num_unit] && @@unit_values[num_unit][:denominator]
        end
      end

      num = num.flatten.compact
      den = den.flatten.compact
      num = UNITY_ARRAY if num.empty?
      base = RubyUnits::Unit.new(RubyUnits::Unit.eliminate_terms(q, num, den))
      @@base_unit_cache[units] = base
      base * @scalar
    end
def to_base
      return self if base?
      if @@unit_map[units] =~ /\A<(?:temp|deg)[CRF]>\Z/
        @signature = @@kinds.key(:temperature)
        base = if temperature?
                 convert_to('tempK')
               elsif degree?
                 convert_to('degK')
               end
        return base
      end

      cached = (begin
                  (@@base_unit_cache[units] * scalar)
                rescue
                  nil
                end)
      return cached if cached

      num = []
      den = []
      q   = Rational(1)
      @numerator.compact.each do |num_unit|
        if @@prefix_values[num_unit]
          q *= @@prefix_values[num_unit]
        else
          q *= @@unit_values[num_unit][:scalar] if @@unit_values[num_unit]
          num << @@unit_values[num_unit][:numerator] if @@unit_values[num_unit] && @@unit_values[num_unit][:numerator]
          den << @@unit_values[num_unit][:denominator] if @@unit_values[num_unit] && @@unit_values[num_unit][:denominator]
        end
      end
      @denominator.compact.each do |num_unit|
        if @@prefix_values[num_unit]
          q /= @@prefix_values[num_unit]
        else
          q /= @@unit_values[num_unit][:scalar] if @@unit_values[num_unit]
          den << @@unit_values[num_unit][:numerator] if @@unit_values[num_unit] && @@unit_values[num_unit][:numerator]
          num << @@unit_values[num_unit][:denominator] if @@unit_values[num_unit] && @@unit_values[num_unit][:denominator]
        end
      end

      num = num.flatten.compact
      den = den.flatten.compact
      num = UNITY_ARRAY if num.empty?
      base = RubyUnits::Unit.new(RubyUnits::Unit.eliminate_terms(q, num, den))
      @@base_unit_cache[units] = base
      base * @scalar
    end
convert to base SI units
 results of the conversion are cached so subsequent calls to this will be fast
 @return [Unit]
 @todo this is brittle as it depends on the display_name of a unit, which can be changed