在C#中将π计算为“无限”二进制精度

前端之家收集整理的这篇文章主要介绍了在C#中将π计算为“无限”二进制精度前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
到目前为止,看起来Fabrice Bellard的基础2方程式是可行的

具有讽刺意味的是,这将需要BigReal类型;我们有.Net这个吗? .Net 4.0有BigInteger.

有人有Haskell版本吗?

解决方法

既然你要求使用由Jerzy Karczmarczuk编写的Haskell版本 here is a paper,称为“世界上最不可靠的技术来计算π”:

This paper is an atypical exercice in
lazy functional coding,written for
fun and instruction. It can be read
and understood by anybody who
understands the programming language
Haskell. We show how to implement the
Bailey-Borwein-Ploue formula for π
in a co-recursive,incremental way
which produces the digits 3,1,4,
5,9. . . until the memory
exhaustion. This is not a way to
proceed if somebody needs many
digits! Our coding strategy is
perverse and dangerous,and it
provably breaks down. It is based on
the arithmetics over the domain of
infinite sequences of digits
representing proper fractions expanded
in an integer base. We show how to
manipulate: add,multiply by an
integer,etc. such sequences from the
left to the right ad infinitum,
which obvIoUsly cannot work in all
cases because of ambiguities. Some
deep philosophical consequences are
discussed in the conclusions.

它并没有以高效或非常实用的方式真正解决问题,而是娱乐性并且展示了懒惰无限精度算法的一些问题.

然后还有this paper by Jeremy Gibbons.

原文链接:https://www.f2er.com/csharp/97219.html

猜你在找的C#相关文章