Re: C Program confused me

1999-03-13 Thread Marcus Brinkmann
On Sat, Mar 13, 1999 at 01:57:58PM +0800, ivan wrote: > > Check out sci.math & the sci.math FAQ (lost the url-sorry) - the faq has > extensive descriptions of several different algorithms for calculating pi. I don't know if it's there, but I like the Monte Carlo method the best. You draw a circl

Re: C Program confused me

1999-03-13 Thread ivan
Check out sci.math & the sci.math FAQ (lost the url-sorry) - the faq has extensive descriptions of several different algorithms for calculating pi. At 06:47 PM 3/12/99 +0800, Bal K. Paudyal wrote: >Hello Friends, > >I encountered following program in one of the Linux Howtos. This calculates >the

Re: C Program confused me

1999-03-12 Thread John Galt
That's a kludgy version of the MacLaurin Series for arctan x= sum (n=0 to infinity) of (-1)^n *x^(2n+1)/2n+1 where x=4 to solve for Pi. Most any Calculus text should have an explanation of it in its section of Power Series, or at least in its Index under Maclaurin series or Taylor series (a more

Re: C Program confused me

1999-03-12 Thread Ares
It is a well known fact in Mathematics that Pi is 4*arctan(1). arctan(x) is the integral from 0 to x of (1/(1+x*x)) or, if you're not mathematically inclined, it is the area between the x axis and 1/(1+x*x) and between the y-axis and x. So, the for loop is simulating this integration. Of course, th

Re: C Program confused me

1999-03-12 Thread Alex Yukhimets
> I encountered following program in one of the Linux Howtos. This calculates > the value of pai. But how does it do this? I am not asking the programming > details, but on what theory the formula is based on. Can anybody help? Is > there any better place to look for help? First of all, remove ';'