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

Re: [FWP] algorithm to calculate pi



Rick Delaney said:
: 
: 
: 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;

Well, if precision *really* doesn't count then there's always
    printf "%.280f\n", 3;

:)

dan, drifting into insanity

-- 
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks


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