加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-15 18:00:14 所属栏目:百科 来源:网络整理
导读:到目前为止,看起来Fabrice Bellard的基础2方程式是可行的 具有讽刺意味的是,这将需要BigReal类型;我们有.Net这个吗? .Net 4.0有BigInteger. 有人有Haskell版本吗? 解决方法 既然你要求使用由Jerzy Karczmarczuk编写的Haskell版本 here is a paper,称为“世
到目前为止,看起来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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读