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

[FWP] algorithm to calculate pi



looking for a short one in Perl. saw one in C:

long a=10000, b,c=2800,d,e,f[2801],g;

int main(int argc, char* argv[]) {
     for (;b-c;)f[b++]=a/5;
     for (;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)
     for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);
     return 0;
}

gets pi's first 280 digits..



------------------------------------------------------------
Email account furnished courtesy of AntiOnline - http://www.AntiOnline.com
AntiOnline - The Internet's Information Security Super Center!


******************************************************
Make FREE long distance phone calls online!	
Click here to use PhoneFREE.com today!
http://adserv.internetfuel.com/cgi-bin/newredirect.cgi?AD=EMAIL-phonefree
******************************************************

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