I always love implementing this (++ if you can tell where the algorithm comes from!)
This version will run (incessantly) as a one-liner as well. -zenofor($|++,$_++,$a++;;$,+=$a/$_,$_++,$a*=-1,$_++){printf"%.16f\n",$,*4}
Update: As MrNobo1024 has answered correctly, this algorithm was discovered by Gregory and Leibniz.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: one-liner pi
by japhy (Canon) on Feb 15, 2001 at 00:43 UTC | |
by zeno (Friar) on Feb 15, 2001 at 14:37 UTC | |
by MrNobo1024 (Hermit) on Feb 15, 2001 at 20:57 UTC | |
by zeno (Friar) on Feb 16, 2001 at 00:31 UTC | |
Re: one-liner pi
by life_monger (Hermit) on Feb 17, 2001 at 00:29 UTC | |
Re: one-liner pi
by MrNobo1024 (Hermit) on Feb 15, 2001 at 03:24 UTC | |
by zeno (Friar) on Feb 15, 2001 at 14:34 UTC |
Back to
Obfuscated Code