From: David Springer Date: 2010-03-09T08:11:48+09:00 Subject: Re: Digits of e (#226) I decided to work on an old quiz. ---------------------- > This week's quiz is to write a Ruby program that can compute the first > 100,000 digits of e. Here is what I came up with: --------------------------------------------------------- PLACES = 100_000 euler = 0 big_one = 10**(PLACES+5) nxt_one = big_one n = 1 while (nxt_one != 0) n += 1 nxt_one /= n euler += nxt_one end puts "2."+euler.to_s[0..PLACES-1] --------------------------------------------------------- It ended up looking a lot like Jay's solution. -- Posted via http://www.ruby-forum.com/.