def as(quantity, unit)
      # if unit wraps a composite unit axis, then convert unit => axis => self and invert
      return 1.0 / unit.as(1.0 / quantity, self) unless CompositeUnit === unit
      raise MeasurementError.new("No conversion from #{self} to #{unit}") unless unit.axes.size == axes.size and unit.operator == operator
      # convert the the first axis quantity to the first unit axis
      first = axes[0].as(quantity, unit.axes[0])
      # convert the remaining units
      vector = REXML::SyncEnumerator.new(axes[1..-1], unit.axes[1..-1]).map { |from, to| from.as(1, to).to_f }
      # apply the operator
      vector.inject(first) { |q, item| q.send(@operator, item) }
    end
def as(quantity, unit)
      # if unit wraps a composite unit axis, then convert unit => axis => self and invert
      return 1.0 / unit.as(1.0 / quantity, self) unless CompositeUnit === unit
      raise MeasurementError.new("No conversion from #{self} to #{unit}") unless unit.axes.size == axes.size and unit.operator == operator
      # convert the the first axis quantity to the first unit axis
      first = axes[0].as(quantity, unit.axes[0])
      # convert the remaining units
      vector = REXML::SyncEnumerator.new(axes[1..-1], unit.axes[1..-1]).map { |from, to| from.as(1, to).to_f }
      # apply the operator
      vector.inject(first) { |q, item| q.send(@operator, item) }
    end
Creates a CompositeUnit from the given units u1 and u2 and operator symbol +:/+ or +:*+.
 Each unit can be either a Unit or another CompositeUnit.
 The remaining parameters are described in Unit.

 The CompositeUnit label is inferred from the operator constituent units, e.g.:
   CompositeUnit.new(Unit.for(:gram), Unit.for(:liter), :/) #=> grams_per_liter
 Returns the the given quantity converted from this Unit into the given unit.