From: Logan Capaldo Date: 2006-01-15T15:23:58+09:00 Subject: Re: Duration between two days On Jan 15, 2006, at 1:12 AM, Brian Buckley wrote: >> irb(main):002:0> require "mathn" > > > Though getting a Rational back is not incorrect, clearly getting a > Fixnum > back would be one's initial expectation. > > Interesting that 'mathn' caused a change in return type. I suppose > that > means the return type is not part of the date subtraction contract. I > quickly eyeballed mathn.rb to try to see the specific reason for > the change > in return type. My guess if that Date - Date uses the ** operator > because > ** is redefined in mathn. > > > Brian Buckley Requiring mathn did not change the return type. Requiring mathn changed how rationals display themselves (ie it changed Rational#inspect). (It also changed Integer#/ to return rationals instead of Integers, among other things I am sure)