From a9ec8adff324bffa6f3cd18620b674e5737ce0bc Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 23 Jan 2003 06:22:50 +0000 Subject: * lib/rational.rb: modified to support "quo". * numeric.c (num_quo): should return most exact quotient value, i.e. float by default, rational if available. * numeric.c (num_div): "div" should return x.divmod(x)[0]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mathn.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'lib/mathn.rb') diff --git a/lib/mathn.rb b/lib/mathn.rb index f3f7a95a48..cd4c6ef9e9 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -106,18 +106,11 @@ class Prime end class Fixnum - alias divmod! divmod - alias / rdiv - def divmod(other) - a = self.div(other) - b = self % other - return a,b - end + alias / quo end class Bignum - alias divmod! divmod - alias / rdiv + alias / quo end class Rational -- cgit v1.2.3