From: Jay Anderson Date: 2010-01-18T13:20:14+09:00 Subject: Re: Digits of e (#226) > ## Digits of e (#226) > > This week�s quiz is to write a Ruby program that can compute the first > 100,000 digits of e. $ cat e.rb digits = 100000 fudge = 10 unity = 10**(digits + fudge) e = unity n = unity i = 0 while (n>0) i += 1 n /= i e += n end e /= 10**fudge p e $ time ruby e.rb > /dev/null real 0m4.023s user 0m3.940s sys 0m0.087s This uses the taylor series definition of e which actually converges quite fast. -----Jay -- Posted via http://www.ruby-forum.com/.