From: David Vallner Date: 2006-01-15T08:29:36+09:00 Subject: Re: Duration between two days On Sat, 14 Jan 2006 16:52:41 +0100, Sky Yin wrote: > > Basic math tells me 2/1 = 2, so what's the point of returning Rational > instead of Fixnum here? > Because the code calculates in rationals? You might want to 'require "mathn"' on the beginning of the script if it bugs you, the module causes Ruby math to work more... err... mathemathically. E.g.: irb(main):001:0> Rational(2, 1) => Rational(2, 1) irb(main):002:0> require "mathn" => true irb(main):003:0> Rational(2, 1) => 2 As always after doing deeper magic, be on the lookout for bugs the module could introduce. David Vallner