计算圆周率,您可以先修改部分代码再运行.
In 1706 John Machin discovered the trigonometric identity
PI = 16 arctan(1/5) - 4 arctan(1/239)
3 5 7 n 2n+1 arctan(x) = x - x /3 + x /5 - x /7 +...+ (-1) x /(2n+1) +..
This program uses arrays of multiple precision digits for the two series terms, for their sum, and for the series. Each 'digit' is a modulo 10000 integer. The number base is 10,000.
In the end, John Machin was never cured.
复制本页链接| 搜索计算圆周率
日期时间模板-计算圆周率。