On Sat, 4 Aug 2001, Eric Lee Green wrote:
>   # Find the gcd of two numbers, self and i, using the
>   # Euclidean algorithm. Seems to work fairly fast!
>   def gcd(i)
>     n=self.clone
>     if n >= i
>       a=n
>       b=i.clone
>     else
>       a=i.clone
>       b=n
>     end
>     while b > 0
>       r = a % b
>       a = b.clone
>       b= r.clone
>     end
>     return a
>   end

I don't know why you are doing #clone at all. It doesn't slow down so much
though (it just returns self, even for Bignum). Try this:

  def gcd(i)
    if self>=i then a,b=self,i else a,b=i,self end
    while b>0 do a,b=b,a%b end
    a
  end

matju