Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: one-liner pi

by life_monger (Hermit)
on Feb 16, 2001 at 19:29 UTC ( #58969=note: print w/replies, xml ) Need Help??


in reply to one-liner pi

TIMTOWTDI...

I think I preserved the "spirit" of the algorithm :-)

#!/usr/bin/perl -w use strict; {(redo)while(printf"%.16f\n",$,+=((-1/++$_/(($a||=1)*=($_-$_++)*-1)))* +4)}

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2019-09-16 08:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (186 votes). Check out past polls.

    Notices?