如何制作Int1024

发布于 2024-08-05 21:38:15 字数 62 浏览 3 评论 0原文

如何在 C# 中声明 int1024?我也可以使用 VB 或 C++。

问候
贝赫鲁兹

how to declare int1024 in C#? i can use VB or C++ Too.

Regards
Behrooz

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

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

发布评论

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

评论(4

久隐师 2024-08-12 21:38:15

请参阅此问题:C# 中的大整数

从该问题的答案:

MS 将在 .NET 4.0 中引入 System.Numerics.BigInteger 类

在那之前,请查看 IntX 类。

<块引用>

IntX 是一个用纯 C# 2.0 编写的任意精度整数库,具有快速的 O(N * log N) 乘法/除法算法实现。它提供了整数的所有基本运算,如加法、乘法、比较、位移等。

See this question: Big integers in C#

From the answer to that question:

MS is going to introduce System.Numerics.BigInteger class in .NET 4.0

Until then, look at IntX class.

IntX is an arbitrary precision integers library written in pure C# 2.0 with fast - O(N * log N) - multiplication/division algorithms implementation. It provides all the basic operations on integers like addition, multiplication, comparing, bitwise shifting etc.

故事还在继续 2024-08-12 21:38:15

你指的是 1024 位整数吗?最好等到 BigInteger4.0。在那之前,您可以对核心库做的最厚颜无耻的事情就是(ab)使用decimal,它的整数部分有96位。或者使用第 3 方 dll。

And by that do you mean a 1024-bit integer? Better wait until BigInteger in 4.0. Until then, the cheekiest you can do with the core libraries is to (ab)use decimal, which has 96 bits for the integer part. Or use a 3rd-party dll.

掩饰不了的爱 2024-08-12 21:38:15

只是为了避免疑问:

public int int1024 = 1024;

Just for avoidance of doubt:

public int int1024 = 1024;
深居我梦 2024-08-12 21:38:15

如果我理解正确的话,你需要一个 1024 位整数。

不幸的是.net 中没有内置的 1024 位整数类型。您必须为此类事情找到一个专门的库或自己编写一个。

有一篇关于大整数的文章 这里

If I understand you correctly you want a 1024 bit integer.

Unfortunately there is no inbuilt 1024 bit integer type in .net. You would have to find a specialised library for that kind of thing or write one yourself.

There is an article about big integers here.

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