Projects Academic PiCalculator Files
Enable build support by adding .onedev-buildspec.yml
.devcontainer Loading last commit info...
ArchimedeanIteration.ans.raw
ArchimedeanIteration.ans.sp
ArchimedeanIteration.py
Gauss-Salamin-Brent-Iteration.ans.raw
Gauss-Salamin-Brent-Iteration.ans.sp
Gauss-Salamin-Brent-Iteration.py
README.md
RamanujanFormula.ans.raw
RamanujanFormula.ans.sp
RamanujanFormula.py
ans.txt
ans.txt.sp
parser.py
README.md

依赖

软件:

  • pypy3.10

包:

  • mpmath

配置

本项目已配置好VSCode Devcontainer,下载之后用VSCode打开,按提示自动完成基础配置,随后在容器里以root权限运行.devcontainer目录下的setup.sh即可配置好运行环境

运行

执行以下命令:

./RamanujanFormula.py >RamanujanFormula.ans.raw
./parser.py -i RamanujanFormula.ans.raw -o RamanujanFormula.ans.sp -l 50
./ArchimedeanIteration.py  >ArchimedeanIteration.ans.raw
./parser.py -i ArchimedeanIteration.ans.raw -o ArchimedeanIteration.ans.sp -l 50
./Gauss-Salamin-Brent-Iteration.py >Gauss-Salamin-Brent-Iteration.ans.raw
./parser.py -i Gauss-Salamin-Brent-Iteration.ans.raw -o Gauss-Salamin-Brent-Iteration.ans.sp -l 50

然后就可以与来自http://www.geom.uiuc.edu/~huberty/math5337/groupe/digits.html的标准答案进行比对,可以看出,小数点后前10000位是准确的

Please wait...
Page is in error, reload to recover