From: Tom Copeland Date: 2003-07-30T11:55:40+09:00 Subject: Re: Hm... nice, Euclid is a one-liner There are some prime number generators here: http://www.rubygarden.org/ruby?OneLiners Yours, Tom > -----Original Message----- > From: Rudolf Polzer [mailto:denshimeiru-sapmctacher@durchnull.ath.cx] > Sent: Tuesday, July 29, 2003 9:37 PM > To: ruby-talk ML > Subject: Hm... nice, Euclid is a one-liner > > > a, b = b, a % b while b != 0 > > That's what I like about Ruby. > > The Perl equivalent is, of course: > > ($a, $b) = ($b, $a % $b) while $b; > > Is there anywhere such a collection of mathematical > algorithms in Ruby? > > > -- > "The obvious mathematical breakthrough would be development > of an easy way > to factor large prime numbers." > -- Bill Gates from The Road Ahead, p265 > >