http://www.perlmonks.org?node_id=58969


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)}