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

  • Thread starter Thread starter CodeMonkey
  • Start date Start date
  • Tags Tags
    Integers
Click For Summary

Discussion Overview

The discussion revolves around the use of arbitrarily long integers in C# programming, specifically exploring the possibility of utilizing the GNU Multiple Precision Arithmetic Library (GMP) on Windows. Participants discuss various approaches, including third-party libraries and installation methods.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks guidance on declaring and using arbitrarily long integers in C#, requesting information about relevant namespaces and classes.
  • Another participant suggests that Microsoft currently lacks built-in support for big integers and recommends searching for third-party classes, mentioning a specific example from CodeProject.
  • A different participant proposes the use of GMP, indicating that it can be backdoor installed and compiled into a gmp.dll for use on Windows.
  • One participant reiterates the suggestion to install GMP, expressing a positive view that this approach is superior.

Areas of Agreement / Disagreement

There is no consensus on the best method to implement big integers in C#. Participants present differing views on the availability of built-in support and the effectiveness of third-party solutions versus GMP.

Contextual Notes

Participants do not clarify the specific limitations or performance considerations of the suggested methods, nor do they resolve the effectiveness of the proposed solutions.

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.
 

Similar threads

  • · Replies 47 ·
2
Replies
47
Views
4K
Replies
1
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
9
Views
3K
Replies
12
Views
2K
  • · Replies 35 ·
2
Replies
35
Views
4K
Replies
4
Views
3K