Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: 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 reply to Re: Golf -- compute PI
by pepik_knize
|
|