Behrooz
Behrooz

Reputation: 1734

how to make Int1024

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

Regards
Behrooz

Upvotes: 2

Views: 2603

Answers (4)

Denk Hanners
Denk Hanners

Reputation: 51

Just for avoidance of doubt:

public int int1024 = 1024;

Upvotes: 3

Marc Gravell
Marc Gravell

Reputation: 1063774

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.

Upvotes: 4

Simon P Stevens
Simon P Stevens

Reputation: 27509

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.

Upvotes: 0

Matthew Scharley
Matthew Scharley

Reputation: 132414

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.

Upvotes: 8

Related Questions