From: Giovanni Intini Date: 2004-11-16T07:48:21+09:00 Subject: Re: mathn.rb is unacceptably slow (proposed replacements) On Sun, 14 Nov 2004 18:49:40 +0900, Yukihiro Matsumoto wrote: > |Here are replacements for Integer#gcd2 and the Prime class which are effectively > |identical (with Prime.cache and Prime#primes_so_far added), but are thousands of > |times faster for any kind of heavy use : > I like this. I will merge this. Thank you both for the proposal and the merge. Prime especially is so slow that for any kind of real life use I have to code some sieve of erathostenes. A good way to check ruby math speed is the euler project at mathchallenge. There are some math problems that must be resolved with a program that takes less than 60 seconds. Anyone can program in his favourite language, and obviously I chose ruby. Most ppl can try the brute force approach most of the times, while I can't when primes are involved and have to think about clever solutions. Being a lazy guy I really needed the faster Primes, thank again :D