The Modern C# Challenge
上QQ阅读APP看书,第一时间看更新

21. Newton's π

Various mathematicians have developed many different ways to approximate π over the years. Sir Isaac Newton devised the following formula to calculate π:

Use Newton's method to approximate π. Let the user enter the number of terms to calculate. Display the approximation and its error.

How does this value compare to the fraction 355/113? Do you need to use checked blocks to protect the code?