用于任意数字精度的 .NET Framework 库

发布于 2024-07-29 10:58:26 字数 55 浏览 2 评论 0原文

我正在重新提出这个问题,并使其更加具体:是否有一个 .NET 框架库支持具有任意精度数字的数字?

I'm reviving this question, and making it more specific: Is there a .NET framework library that supports numbers with arbitrary digits of precision?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

红ご颜醉 2024-08-05 10:58:28

您可以使用十进制类型,它提供 28-29 个有效数字

You can use decimal type which gives you 28-29 significant digits

↘紸啶 2024-08-05 10:58:27

您可以尝试旧的尾数方法。 基本上,您可以使用 64 位整数来存储数字,然后使用 64 位整数来存储指数(可能为负数)。 您可以构建自己的对象类型并重载算术运算符,因此它将被视为单个数字。 这需要一些工作,但我认为这将是您的最佳选择。

You could try the old method of mantissa. Basically you could have an 64 bit integer for storing the number and then a 64 bit integer for storing the exponent (which could be negative). You could build your own object type and overload the arithmetic operators, so it will be treated as a single number. It will require some work, but I think it will be your best option.

抱猫软卧 2024-08-05 10:58:27

GnuMpDotNet:http://www.emilstefanov.net/Projects/GnuMpDotNet/

如果您需要纯.NET考虑研究一下:http://www.codeplex.com/IntX/

GnuMpDotNet: http://www.emilstefanov.net/Projects/GnuMpDotNet/

If you need pure .NET consider looking into this: http://www.codeplex.com/IntX/

静待花开 2024-08-05 10:58:27

Perhaps surprisingly, the Bailey-Borwein-Plouffe formula gives an incremental procedure for computing the next binary or hexadecimal digit of pi without needing to store all the previous digits.

清秋悲枫 2024-08-05 10:58:27

如果您想要一个非常快的库,请尝试:

http://www.emilstefanov.net/Projects/GnuMpDotNet /

If you want a really fast library then try:

http://www.emilstefanov.net/Projects/GnuMpDotNet/

假面具 2024-08-05 10:58:26

您能等待 .NET 4.0 吗? 他们是将 BigInteger 直接引入框架

另一方面,如果您等不及,那么 J# 运行时包含内置的-支持java.math.BigInteger 和BigDecimal。 就像 .NET Framework 的其余部分一样,它是可重新分发的。

Can you wait for .NET 4.0? They're bringing BigInteger directly into the Framework.

On the other hand, if you can't wait, then the J# runtime includes built-in support for java.math.BigInteger and BigDecimal. This is redistributable just like the rest of the .NET Framework.

半寸时光 2024-08-05 10:58:26

这里有几个选项。

一个不错的选择是 W3b.Sine,它是原生 C#/.NET,并且支持任意精度浮点值。

如果您只处理整数值,IntX 提供对任意精度整数值的支持。 一个可能更成熟的选项是 C# BigInt,但同样,这不支持浮点运算。

There are a few options here.

A good option is W3b.Sine, which is native C#/.NET, and supports arbitrary precision floating point values.

If you are only dealing with integer values, IntX provides support for arbitrary precision integer values. A potentially more mature option would be C# BigInt, but again, this will not support floating point operations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文