<div dir="ltr">> Write a script to calculate the value of e, also known as Euler’s number and Napier’s constant. <br><br>Which is 1 + ( 1 / $n ) )**$n , where $n approaches infinity.<br clear="all"><div><br>It is easy to put that in a subroutine compute_euler ( $n ), and then increment $n until you blow off the top of Perl 5's integer. <br><br>I think the closest you could get without getting into Math::BigFloat would be 2.71828182845904 , and I'm not seeing clear enough documentation to really work on it. I suspect that $x = Math::BigFloat->new( 1 + ( 1 / $n ) )**$n ) wouldn't work as intended, not because of problems with Math::Float, but because Perl 5 can't handle the equation within the new() well enough to give a Math::BigFloat result.</div><div><br>Meanwhile, another site says:<br><br>> But it is known to over 1 trillion digits of accuracy!<br><br>So, when is it "done"? When we get to billions of digits? The 50 digits listed on the wiki page? compute_euler( 2 ** 53 ) to get the largest int Perl can handle without BigInt? <br><br>I think this question is underspecified. Thoughts? Suggestions?</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Dave Jacoby<br>
<a href="mailto:jacoby.david@gmail.com" target="_blank">jacoby.david@gmail.com</a><br>
<br>I deal with my software the way I treat my eldritch abomination: <br> It's not human, it's not even alive in the natural sense. </div><div dir="ltr"> It's nightmare-born and nightmare-shaped, and nightmares don't die easy.<br>  -- @yenzie</div></div></div></div></div>