![]() |
![]() |
#1 |
Bemusing Prompter
"Danny"
Dec 2002
California
5·499 Posts |
![]()
I'm looking for some C or C++ code that can perform modular operations on very large numbers. I know that GMP is useful, but I've heard that it only works on Unix and Unix-like systems. Is there any way to run GMP code on Windows?
I know that there's also the MIRACL package, but it isn't free ('free' as in free software) and I prefer to use open source software. Thanks. |
![]() |
![]() |
![]() |
#2 |
Jun 2005
USA, IL
193 Posts |
![]() |
![]() |
![]() |
![]() |
#3 |
Bemusing Prompter
"Danny"
Dec 2002
California
5·499 Posts |
![]()
I'll check it out tonight.
Thanks for the link! |
![]() |
![]() |
![]() |
#4 |
Jun 2003
160510 Posts |
![]()
I like NTL (google it). Works with visual C++.
Last fiddled with by Citrix on 2007-10-23 at 03:23 |
![]() |
![]() |
![]() |
#5 |
"Frank <^>"
Dec 2004
CDP Janesville
212210 Posts |
![]()
Another library to look at is LibTomMath over at http://libtom.org/
Included with the code is a 200+ page book (pdf) that serves as an introductory textbook to the theory behind the library. Written in generic C, it will compile with GCC or VC++ v6 with no additional configuration. Frank |
![]() |
![]() |
![]() |
#6 |
Bemusing Prompter
"Danny"
Dec 2002
California
5×499 Posts |
![]()
I put the gmp.h file in the same folder as my .cpp file, in which I put the line #include <gmp.h>. Am I doing things correctly?
|
![]() |
![]() |
![]() |
#7 | |
"Robert Gerbicz"
Oct 2005
Hungary
32×179 Posts |
![]() Quote:
#include "gmp.h" And it is not enough to put only gmp.h in the folder. You have to build the gmp library! As I can remember: download gmp-4.2.2.tar.gz from: http://gmplib.org/ Put this into a folder. Then tar xfvz gmp-4.2.2.tar.gz ./configure make make check It takes some hours on the computer. Not so fast. Last fiddled with by R. Gerbicz on 2007-11-05 at 19:49 |
|
![]() |
![]() |
![]() |
#8 |
Bemusing Prompter
"Danny"
Dec 2002
California
5·499 Posts |
![]()
OK, I've installed Cygwin and added the appropriate packages (make, gcc, and m4). However, I seem to be having problems.
I entered the "./configure" command and it said that there was no such file or directory. I then tried "make" and it told me that I needed a "makefile." Ugh, GMP isn't as user-friendly as I thought. |
![]() |
![]() |
![]() |
#9 | |
"Mark"
Apr 2003
Between here and the
2×592 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Einyen
Dec 2003
Denmark
D6A16 Posts |
![]()
I use GMP in windows with Visual C++. Here are the GMP 4.2.2 files compiled on a P4 Prescott 3.4 Ghz:
gmp.h libgmp-3.dll.dll libgmp-3.lib I place gmp.h in 2 folders inside the visual studio folder: Microsoft Visual Studio 6\VC98\Include\ Microsoft Visual Studio 6\VC98\CRT\SRC\ "libgmp-3.dll.dll" I place in any folder that is in the path line, I just put it in c:\windows. (I'm not sure why its called .dll.dll, I think I made a mistake during compiling, but it works). libgmp-3.lib I place in all project folders where I use GMP and I add it to the project under files Resource library, and add #include <gmp.h> in the header. |
![]() |
![]() |
![]() |
#11 |
Bemusing Prompter
"Danny"
Dec 2002
California
1001101111112 Posts |
![]()
Hmm, I'm using Dev-C++. Do you have advice for using this IDE?
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Basic Number Theory 5: rationals & intro to modular arithmetic | Nick | Number Theory Discussion Group | 1 | 2016-10-21 22:21 |
modular arithmetic | science_man_88 | Miscellaneous Math | 42 | 2011-07-26 02:02 |
modular arithmetic problem | JuanTutors | Math | 4 | 2009-03-11 16:06 |
Modular Arithmetic | Numbers | Math | 27 | 2005-11-30 15:41 |
Jim Howell's modular arithmetic program? | ixfd64 | Software | 0 | 2004-05-27 05:42 |