Keep It Simple, Stupid | |
PerlMonks |
Good to about 45 places; spigot algorithmby tmoertel (Chaplain) |
on Jul 21, 2004 at 18:02 UTC ( [id://376340]=note: print w/replies, xml ) | Need Help?? |
The output of the obfuscated code seems to be good for about 45 places (at least on my box running Perl v5.8.3 built for i386-linux-thread-multi) before it differs from the reference values from the On-Line Encyclopedia of Integer Sequences.
If you want more precision, you might be interested in Unbounded Spigot Algorithms for the Digits of π by Jeremy Gibbons. It's a fun read, and you can adapt the methods presented in his paper to computing e digit by digit.
In Section
Obfuscated Code
|
|