>From: Klaus Stein <steink / ping.informatik.tu-muenchen.de>

> I also would like to do calculations on units, so that I can write:
> s=FwU.new(100,Unit.m)  # shold be shorter, perhaps: s=FwU(100,:m)
> t=FwU.new(10,Unit.s)
> v=s/t
> v       --> 10
> v.unit  --> [[Unit.m, 1], [Unit.s, -1]]
> # any ideas to do this nicer?

Try this:

  http://raa.ruby-lang.org/list.rhtml?name=quanty

% irb -r quanty
irb(main):001:0> s=Quanty.new(100,"m")
Quanty(100,'m')
irb(main):002:0> t=Quanty.new(10,"s")
Quanty(10,'s')
irb(main):003:0> v=s/t
Quanty(10,'m / s')
irb(main):004:0> v.want("km/hour")
Quanty(36.0,'km/hour')

Masahiro Tanaka