how to declare int1024 in C#? i can use VB or C++ Too.
Regards
Behrooz
how to declare int1024 in C#? i can use VB or C++ Too.
Regards
Behrooz
See this question: http://stackoverflow.com/questions/176775/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.
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.
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.