声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3353|回复: 7

[C/C++] [推荐]任意精度计算原代码

[复制链接]
发表于 2005-7-27 08:47 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
apfloat  (http://www.apfloat.org/apfloat/
A C++ High Performance Arbitrary Precision Arithmetic Package

--------------------------------------------------------------------------------
Apfloat is a high performance arbitrary precision package. That means you can do calculations involving millions of digits with it. It uses Number Theoretic Transforms. It's simple to use. It's fast. It's freeware.
A Java version is also available.

Apfloat could be compiled in general with most C++ compilers, however gcc is recommended. It has assembler optimizations for x86, Alpha and MIPS processors.

A sample program for calculating pi is included in the package. Calculating one million digits of pi takes less than half a minute with an Athlon XP computer. This makes it one of the fastest programs for calculating pi (faster than the Japanese super_pi program).

Compiled executables for calculating pi are available for download. The fastest versions of the program can calculate up to 226 million decimal digits of pi. A machine with at least 256 MB of RAM would be needed for such a calculation. A version, which can calculate up to 1.9 billion digits (if you have at least two gigabytes of memory) is also provided, but it is somewhat slower.

[ 本帖最后由 yejet 于 2006-11-13 09:19 编辑 ]
回复
分享到:

使用道具 举报

发表于 2005-7-27 09:56 | 显示全部楼层
<P>楼主有可以增加fortran的精度的工具不?</P>
<P>谢谢</P>
发表于 2005-7-27 10:10 | 显示全部楼层

求助:怎样用matlab 产生多项分布随机数

<P>增加fortran的精度?</P>
<P>你是指变量的位数?</P>
<P>double precision不够你用吗</P>
发表于 2005-7-28 10:05 | 显示全部楼层
你试一下这个,据说可以将fortran的数据类型扩展到很高精度的一个库函数

我还没用过

http://forum.vibunion.com/forum/viewthread.php?tid=31585
发表于 2005-7-28 11:08 | 显示全部楼层
提高精度,不就取决你用的差分格式和算法么,还有别的办法么?
发表于 2005-7-28 11:11 | 显示全部楼层
还有小数点后边的位数,不过感觉有点吹毛求疵
 楼主| 发表于 2005-7-28 17:37 | 显示全部楼层
<P>确实关键因素还是网格和算法的问题</P>
发表于 2005-7-29 18:30 | 显示全部楼层
<DIV class=quote><B>以下是引用<I>多情清秋</I>在2005-7-27 10:10:04的发言:</B><BR>
<P>增加fortran的精度?</P>
<P>你是指变量的位数?</P>
<P>double precision不够你用吗<BR><BR><BR>有的时候,需要更多的有效位数.<BR><BR>fortran中只带的矩阵计算如:<BR>((KXY.XI.KYY).XT.KXY)<BR>当时发现kyy的数量级达到10e9时,计算就有问题了.<BR>只好先将kyy/10e9后再在总体上乘10e9.<BR><BR></P></DIV>
<br>
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-11 01:05 , Processed in 0.076883 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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