lib/quantify/unit/base_unit.rb
# Divide one unit by another. This results in the generation of a compound
# unit.
#
# In the event that the new unit represents a known unit, the non-compound
# representation is returned (i.e. of the SI or NonSI class).
#
Divide one unit by another. This results in the generation of a compound
unit.

In the event that the new unit represents a known unit, the non-compound
representation is returned .
Divide one unit by another . This results in the generation of a compound unit . In the event that the new unit represents a known unit the non - compound representation is returned .
def divide(other)
        options = []
        self.instance_of?(Unit::Compound) ? options += @base_units : options << self
        if other.instance_of? Unit::Compound
          options += other.base_units.map { |base| base.index *= -1; base }
        else
          options << CompoundBaseUnit.new(other,-1)
        end
        Unit::Compound.new(*options)
      end
def divide ( other ) options = [ ] self . instance_of? ( Unit :: Compound ) ? options += @base_units : options << self if other . instance_of? Unit :: Compound options += other . base_units . map { | base | base . index *= - 1 ; base } else options << CompoundBaseUnit . new ( other , - 1 ) end Unit :: Compound . new ( * options ) end
Divide one unit by another.
Divide one unit by another .
other
<not_specific>