![]() |
|
"be consistent" | |
PerlMonks |
Re: Golf -- compute PIby pepik_knize (Scribe) |
on Apr 16, 2002 at 15:54 UTC ( #159541=note: print w/replies, xml ) | Need Help?? |
Here's one using Archimedes's method that comes in at 67: $n=3;$s=1;for(1..9){$n*=2;$s=(2-(4-$s**2)**.5)**.5;$p=$n*$s}print$p As a side note, I had $_ instead of $p inside the curlies, but using just print outside didn't work, and I don't know why. Pepik
In Section
Meditations
|
|