找回密码
 欢迎注册
楼主: liangbch

[擂台] 计算百万位e

[复制链接]
发表于 2009-4-20 19:41:02 | 显示全部楼层
打印Pi的一万位:
  1. #include <stdlib.h>
  2. #include <stdio.h>

  3. long a=10000,b,c=15000,d,e,f[15001],g;

  4. int main()
  5. {
  6. for(;b-c;)
  7. f[b++]=a/5;
  8. for(;d=0,g=c*2;c-=15,printf("%.4d",e+d/a),e=d%a)
  9. for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);
  10. system("PAUSE");
  11. return 0;

  12. }
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2009-11-13 15:16:40 | 显示全部楼层
本帖最后由 liangbch 于 2009-11-13 15:19 编辑

关于使用AGM计算对数的算法,请参阅本站 http://bbs.emath.ac.cn/viewthrea ... fromuid=25#pid23276 26# 给出的论文。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-2-12 21:16:00 | 显示全部楼层
我写程序只能用VB。慢啊。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-4-26 12:26 , Processed in 0.045530 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表