codebytes: Calculating the value of PI accurately to 5 decimal places
This program uses the Gregory-Leibniz series for calculating the value of PI. Note that this series is slow and there exist other faster algorithms for calculating the value of PI.A simple infinite series for π is the Gregory–Leibniz series:
As individual terms of this infinite series are added to the sum, the total gradually gets closer to π, and – with a sufficient number of terms – can get as close to π as desired. It converges quite slowly, though – after 500,000 terms, it produces only five correct decimal digits of π.
Read full article from codebytes: Calculating the value of PI accurately to 5 decimal places
No comments:
Post a Comment