Ah here we go, I googled it and it came up with basically what I was saying:

Math Forum - Ask Dr. Math

EDIT: Here's some more fun: 1 Million Digits of Pi

Code:

$|=3,141592;sub _
{[email protected]_}sub o{_++$O[0
];_ 0for 1..$#O}sub O{$;=int
$=/10,'0/^ ^';if($;<9)
{_$_ for @O;;@O=()
;0}push @O,$;;0
,;[email protected] O,'.'if
$^==1; 0;if($;
==10){ print ,o,@O=(
)}}$?= 1000000 ;$-=10*
(q/@O= digits of pi =10/,1)
*int($? /3)+1;$
[email protected] ,[0..$-]
,;for$^ (1..$?){
$"=$-;$O =0;until
($"<0){$/= 2*$"+1;$/=
10if$/==1;$==10*$,[$"]+$O;$,
[$"]=$=%$/;$O=int($=/$/
)*$"--,10}O}o

I tested it on my box. It seems to work, though artificially slowly.

## Bookmarks