Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Golf -- compute PI

by I0 (Priest)
on Apr 17, 2002 at 16:14 UTC ( #159872=note: print w/ replies, xml ) Need Help??


in reply to Golf -- compute PI

How about e:

use integer;$|++;my@e=(1)x5e3;for(a..zzz){$e[$_-1]+=$e[$_]/$_,$e[$_]%= +$_ for reverse 1..$#e;print$e[0];$e[0]=0;$_*=10for@e;}


Comment on Re: Golf -- compute PI
Download Code
Re^2: Golf -- compute PI
by thospel (Hermit) on Jan 21, 2007 at 12:21 UTC
    Compute e to 1000 digits, 69 chars
    s!\w+!$%=($z=$&.0+$%)/($a=--$?||10);$z%$a!eg,print$%for(-1x65536)x1e3

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://159872]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2015-07-05 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls