From ef260b085eea729efaa46e93ac71d08a3fa210c6 Mon Sep 17 00:00:00 2001 From: matz Date: Sun, 30 Mar 2008 15:00:12 +0000 Subject: revert git backfire in r15860; sorry git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/complex.rb | 32 -------------------------------- lib/rational.rb | 32 -------------------------------- 2 files changed, 64 deletions(-) (limited to 'lib') diff --git a/lib/complex.rb b/lib/complex.rb index 505b0120e3..9d926023a7 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -1,35 +1,3 @@ -class Integer - - def gcd(other) - min = self.abs - max = other.abs - while min > 0 - tmp = min - min = max % min - max = tmp - end - max - end - - def lcm(other) - if self.zero? or other.zero? - 0 - else - (self.div(self.gcd(other)) * other).abs - end - end - - def gcdlcm(other) - gcd = self.gcd(other) - if self.zero? or other.zero? - [gcd, 0] - else - [gcd, (self.div(gcd) * other).abs] - end - end - -end - module Math alias exp! exp diff --git a/lib/rational.rb b/lib/rational.rb index b12bf7ef38..87c5d3f111 100644 --- a/lib/rational.rb +++ b/lib/rational.rb @@ -15,35 +15,3 @@ class Bignum alias rpower ** end - -class Integer - - def gcd(other) - min = self.abs - max = other.abs - while min > 0 - tmp = min - min = max % min - max = tmp - end - max - end - - def lcm(other) - if self.zero? or other.zero? - 0 - else - (self.div(self.gcd(other)) * other).abs - end - end - - def gcdlcm(other) - gcd = self.gcd(other) - if self.zero? or other.zero? - [gcd, 0] - else - [gcd, (self.div(gcd) * other).abs] - end - end - -end -- cgit v1.2.3