pi = 0.0
N = 100
For I(N) in the range:
pi += ( 1/pow( 16,i) *(? 4/(8 * I+ 1)-2/(8 * I+4)- 1/(8 * I+5)- 1/(8 * I+6)))?
Print ('pi is {:. 10f})。 Format (pi))
Please copy the above code to the python language development environment and run it, and the result is as follows (the following figure shows the result of running the above code using python development environment Spyder): pi is 3. 14 15926536.
The appearance of extended data computer makes the calculation of π value develop by leaps and bounds. 1949, the world's first American-made computer ENIAC (Electronic Numerical Integrator and Computer) was put into use at Aberdeen proving ground. The following year, Ritter wiesner, Von Newman and Mezopolis used this computer to calculate the 2037 decimal places of π.
It took the computer only 70 hours to finish the work. Deducting the time of punching in and out is equivalent to calculating single digits in two minutes on average. Five years later, IBM NORC (Naval Weapons Research Computer) calculated the 3089 decimal places of π in only 13 minutes.
References:
Baidu encyclopedia -Pi