[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] algorithm to calculate pi




Michael Assels wrote:
> 
> I can't promise 280 digits, but here's something shorter:
> 
> #!/usr/bin/perl -l
> for(0..9999){$i=$_*8;$p+=(16**-$_)*(4/($i+1)-2/($i+4)-1/($i+5)-1/($i+6))}print$p

Well, if precision doesn't count then there's always

    print 4*atan2 1,1;

-- 
Rick Delaney
rick.delaney@home.com

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe