Can I Use Big Integers in C# with GMP on Windows?

  • Thread starter Thread starter CodeMonkey
  • Start date Start date
  • Tags Tags
    Integers
AI Thread Summary
To work with arbitrarily long integers in C#, users can utilize third-party libraries since Microsoft does not provide a built-in solution. A recommended resource is the BigInteger class available on CodeProject, which offers functionality for handling large numbers. However, performance may be an issue, particularly for numbers exceeding 30 digits, similar to the Java BigNumber implementation. For improved performance, users can consider installing the GNU Multiple Precision Arithmetic Library (gmp), which can be compiled into a gmp.dll for use on Windows. This library is noted for its superior handling of large integers compared to other options.
CodeMonkey
Messages
11
Reaction score
0
I want to use arbitrarily long integers in Csharp, can you tell me how to declare and use this. Please explain the namespace, classes used as I'm very new to this. Thanks.
 
Technology news on Phys.org
I don't think Microsoft has anything for this at the moment. You should be able to Google up third-party classes for big numbers, though; http://www.codeproject.com/csharp/biginteger.asp would be an example.

Frankly, it's no better than the Java BigNumber implementation, which also has poor performance for large numbers (> 30 digits, say).
 
Last edited by a moderator:
You can backdoor install gmp - the GNU package for large numbers. It's possible to compile a gmp.dll that you can use in Windows. See:

http://cs.nyu.edu/exact/core/gmp/
 
jim mcnamara said:
You can backdoor install gmp - the GNU package for large numbers. It's possible to compile a gmp.dll that you can use in Windows.

Oh yes, this is much better.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top