go ahead... be a heretic  
PerlMonks 
Caclulation of eby doc (Scribe) 
on Jul 17, 2004 at 08:24 UTC ( #375212=perlquestion: print w/replies, xml )  Need Help?? 
doc has asked for the wisdom of the Perl Monks concerning the following question: OK so Google wants you to find a prime in e, so lots of people are into e at the moment. Given I can get a couple of million digits of e online (and I've already answered both quiz questions just to see where it led) I am interested in why/how the algorithms at e actually work. Euler's original equation e = 1 + 1/1! + 1/2! + 1/3! .... is obviously limited in accuracy by the size of the floating point value you can work with. To calculate a lot of digits, an alternative approach is needed which is not limited by the accuracy of the floating point you can work with. Now you can express e as e=1+1+1/2(1+1/3(1+1/4(1+1/5(1+.....)))) which means that when you work from the inside out the calculations only use small integer division. I presume that this is what is being done at e with the reverse walking and a carry up the integer array. The thing is I simply don't get it? Anyone able to enlighten me or provide a reference? This looks simple enough.....
Mazal tov.
Back to
Seekers of Perl Wisdom

