![]() |
![]() |
#1 | |
May 2006
Malaysia
112 Posts |
![]() Quote:
Please can Anyone tell me where I should write the C Code. After I did all the step I have only Msys in the start menu So I intalled the MinGW Developer Studio, then I wrote the simple C Code like this : #include <stdint.h> #include <stdio.h> #include <string.h> #include<C:\GNU\1.0\home\Mahmoud Maqableh\gmp-4.1\gmp.h> #include<conio.h> int main() { mpf_t r; mpf_init(r); printf("\n\t The valuse of Xn = %F",r); mpf_clear (r); return 0; } When I do the Compile there is no any Error, but if I do Run I have 2 Errors: H:\Simple.c:16: undefined reference to `__gmpf_init' H:\Simple.c:21: undefined reference to `__gmpf_clear' Can Anyone Help me to eliminate these Errors. My E-mail : Maqableh_cs@yahoo.com Mahmoud Maqableh, Balila |
|
![]() |
![]() |
![]() |
#2 |
May 2006
Malaysia
310 Posts |
![]()
Helllo Everyone
I want to install GMP Library on windows XP, I did that but I have problem I did the Installation like this : 1) Download the current Mingw http://prdownloads.sf.net/mingw/MinG...1.exe?download and MSYS http://prdownloads.sf.net/mingw/MSYS...0.exe?download 2) I made a folder called GNU and installed MinGW in c:\GNU\MinGW 3) I installed MSYS in c:\GNU\msys Now you get an icon on the desktop where you can start the MinSys. Do this, because is creates your home folder. Then exit it again. 4) Download gmp and place it in your newly created home folder. (For me is was called C:\GNU\msys\1.0\home\Maqableh ) 5) Start the MinSys up again from the desktop and type gunzip gmp-4.1.4.tar.gz tar -xvf gmp-4.1.4.tar cd gmp-4.1.4 ./configure make install Please can Anyone tell me where I should write the C Code. After I did all the step I have only Msys.exe in the start menu So I intalled the MinGW Developer Studio, then I wrote the simple C Code like this : #include <stdint.h> #include <stdio.h> #include <string.h> #include<C:\GNU\1.0\home\Mahmoud Maqableh\gmp-4.1\gmp.h> #include<conio.h> int main() { mpf_t r; mpf_init(r); printf("\n\t The valuse of Xn = %F",r); mpf_clear (r); return 0; }When I do the Compile there is no any Error, but if I do Run I have 2 Errors: H:\Simple.c:16: undefined reference to `__gmpf_init' H:\Simple.c:21: undefined reference to `__gmpf_clear' I do not know what was the problem. Can Anyone Help me to eliminate these Errors."correct the Linking Error" OR send to me Step-by-step How I can install GMP-4.2 on Windows XP and do Run to the previous Code. Please I need the Help urgent. Note: My PC CPU is : Intel(R) Celeron CPU 2.4GHzis it compatible with Intel P4???? I think GMP do not work with any CPU!!!!!!! My E-mail : Maqableh_cs@yahoo.com Mahmoud Maqableh, Balila |
![]() |
![]() |
![]() |
#3 |
May 2006
Malaysia
3 Posts |
![]()
Helllo Everyone
I want to install GMP Library on windows XP, I did that but I have problem I did the Installation like this : 1) Download the current Mingw http://prdownloads.sf.net/mingw/MinG...1.exe?download and MSYS http://prdownloads.sf.net/mingw/MSYS...0.exe?download 2) I made a folder called GNU and installed MinGW in c:\GNU\MinGW 3) I installed MSYS in c:\GNU\msys Now you get an icon on the desktop where you can start the MinSys. Do this, because is creates your home folder. Then exit it again. 4) Download gmp and place it in your newly created home folder. (For me is was called C:\GNU\msys\1.0\home\Maqableh ) 5) Start the MinSys up again from the desktop and type gunzip gmp-4.1.4.tar.gz tar -xvf gmp-4.1.4.tar cd gmp-4.1.4 ./configure make install Please can Anyone tell me where I should write the C Code. After I did all the step I have only Msys.exe in the start menu So I intalled the MinGW Developer Studio, then I wrote the simple C Code like this : #include <stdint.h> #include <stdio.h> #include <string.h> #include<C:\GNU\1.0\home\Mahmoud Maqableh\gmp-4.1\gmp.h> #include<conio.h> int main() { mpf_t r; mpf_init(r); printf("\n\t The valuse of Xn = %F",r); mpf_clear (r); return 0; } When I do the Compile there is no any Error, but if I do Run I have 2 Errors: H:\Simple.c:16: undefined reference to `__gmpf_init' H:\Simple.c:21: undefined reference to `__gmpf_clear' I do not know what was the problem. Can Anyone Help me to eliminate these Errors."correct the Linking Error" OR send to me Step-by-step How I can install GMP-4.2 on Windows XP and do Run to the previous Code. Please I need the Help urgent. Note: My PC CPU is : Intel(R) Celeron CPU 2.4GHz is it compatible with Intel P4???? I think GMP do not work with any CPU!!!!!!! My E-mail : Maqableh_cs@yahoo.com Mahmoud Maqableh, Balila |
![]() |
![]() |
![]() |
#4 |
"Nancy"
Aug 2002
Alexandria
2,467 Posts |
![]()
Posts moved, they don't relate to GMP-ECM 6.0.
Alex |
![]() |
![]() |
![]() |
#5 |
Aug 2002
14016 Posts |
![]()
You have to link with the GMP library.
If you're using the command-line, try adding -lgmp |
![]() |
![]() |
![]() |
#6 |
May 2006
USA
216 Posts |
![]()
Hello,
Please, Can I ask you question???? I am using GMP library, and I want to multiply two big numbers each one consist of 160-bit. One of these numbers should be less than 1. Example : A=12345678901234567890123456789012345678901234567890. B=0.12345678901234567890123456789012345678901234567890. I tried to do the following but I can not successed. void multip { mpf_t A,B; mpf_init2(A,160); mpf_init2(B,160); mpf_set (A,12345678901234567890123456789012345678901234567890); mpf_set (B,0.12345678901234567890123456789012345678901234567890); gmp_printf("\n\t The valuse of A n = %Ff ",A); gmp_printf("\n\t The valuse of A n = %Ff ",B); mpf_clear (A); mpf_clear (B); } The compile Result: chaos.c: In function `main': chaos.c:25: warning: integer constant is too large for this configuration of the compiler - truncated to 64 bits chaos.c:25: warning: decimal constant is so large that it is unsigned chaos.c:25: warning: passing arg 2 of `__gmpf_set' makes pointer from integer without a cast chaos.c:71:3: warning: no newline at end of file if I want to see the chaos.exe I can not, and told me you should close theprogram. ![]() Please Can you tell me how to do assignment to those variable, and how to multipy like this big numbers. ![]() Thanks in Advans Marten, |
![]() |
![]() |
![]() |
#7 |
May 2006
USA
2 Posts |
![]()
How to multipy Two Big numbers using GMP
------------------------------------------------------------------------- Hello, Please, Can I ask you question???? I am using GMP library, and I want to multiply two big numbers each one consist of 160-bit. One of these numbers should be less than 1. Example : A=12345678901234567890123456789012345678901234567890. B=0.12345678901234567890123456789012345678901234567890. I tried to do the following but I can not successed. void multip { mpf_t A,B; mpf_init2(A,160); mpf_init2(B,160); mpf_set (A,12345678901234567890123456789012345678901234567890); mpf_set (B,0.12345678901234567890123456789012345678901234567890); gmp_printf("\n\t The valuse of A n = %Ff ",A); gmp_printf("\n\t The valuse of A n = %Ff ",B); mpf_clear (A); mpf_clear (B); } The compile Result: chaos.c: In function `main': chaos.c:25: warning: integer constant is too large for this configuration of the compiler - truncated to 64 bits chaos.c:25: warning: decimal constant is so large that it is unsigned chaos.c:25: warning: passing arg 2 of `__gmpf_set' makes pointer from integer without a cast chaos.c:71:3: warning: no newline at end of file if I want to see the chaos.exe I can not, and told me you should close theprogram. ![]() Please Can you tell me how to do assignment to those variable, and how to multipy like this big numbers. ![]() Thanks in Advans Marten, Last fiddled with by akruppa on 2006-05-05 at 09:29 Reason: Post merged with your earlier thread. |
![]() |
![]() |
![]() |
#8 |
"Nancy"
Aug 2002
Alexandria
246710 Posts |
![]()
Try the GMP manual at http://www.swox.com/gmp/manual/, especially the "Basics: What every GMP user should know" section.
Alex Last fiddled with by akruppa on 2006-05-05 at 09:34 |
![]() |
![]() |
![]() |
#9 |
Aug 2002
26×5 Posts |
![]()
You can't use literals that big. Use the functions that accept strings.
|
![]() |
![]() |
![]() |
#10 |
Mar 2004
Belgium
11010011112 Posts |
![]()
FWIW, in Java you can use the BigInteger Class (java.lang.math.BigInteger)
Regards Cedric |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Abortion debate (moved from 2012 election thread) | Christenson | Soap Box | 167 | 2022-08-03 12:36 |
Escaping drivers (moved from 4788 thread) | schickel | Aliquot Sequences | 10 | 2012-05-22 10:50 |
DNS Hijack (moved from Server problems thread) | c10ck3r | Lounge | 10 | 2012-05-18 06:02 |
Factor5 source code thread | ET_ | Operation Billion Digits | 10 | 2008-09-17 12:28 |
Mfactor sieve code thread | ewmayer | Operation Billion Digits | 27 | 2006-11-03 08:05 |