olbrich/ruby-units — pull request #108 by ahacking (2014-09-09 16:49:02+00:00)
Title: Make percentage units work like a unitless scalar.

The following percentage based calculations now work as shown:
``Unit('50 %') * Unit('50 %) == Unit('25 %')``
``Unit('50 m') * Unit('10 %) == Unit('5 m')``
``Unit('10 %') * Unit('50 m) == Unit('5 m')``
``Unit('50 m') / Unit('10 %) == Unit('500 m')``
``Unit('50 %') / Unit('10 m) == Unit('1/20 m')``
``Unit('50 %') / Unit('50 %) == Unit(1)``
``Unit('50 %').divmod Unit('50 %) == [1,0]``
``Unit('15 m').divmod Unit('6 %) == [Unit('250 m'), Unit('0 m')]``

A side effect of this enhancement is divmod now also works correctly with the same unit support as regular division:
``Unit('15 m').divmod Unit('6') == [Unit('2 m'), Unit('3 m')]``
``Unit('15 m').divmod Unit('6 cm') == [Unit('2 m/cm'), Unit('3 m/cm')]``