From glumor at faza.ru Sat Jul 1 16:19:21 2006 From: glumor at faza.ru (glumor@faza.ru) Date: Sat, 01 Jul 2006 09:19:21 -0500 Subject: Visit this sites! Message-ID: Visit http://arbat.or.at/adipex/ http://arbat.or.at/xanax/ http://arbat.or.at/phentermine/ http://arbat.or.at/cialis/ http://arbat.or.at/viagra/ From glumor at faza.ru Sat Jul 1 16:21:53 2006 From: glumor at faza.ru (glumor@faza.ru) Date: Sat, 01 Jul 2006 09:21:53 -0500 Subject: Visit this sites! Message-ID: Visit http://arbat.or.at/adipex/ http://arbat.or.at/xanax/ http://arbat.or.at/phentermine/ http://arbat.or.at/cialis/ http://arbat.or.at/viagra/ From glumor at faza.ru Sat Jul 1 18:13:59 2006 From: glumor at faza.ru (glumor@faza.ru) Date: Sat, 01 Jul 2006 11:13:59 -0500 Subject: Visit this sites! Message-ID: Visit http://alcoholico-es.info/ http://arbat.or.at/adipex/#adipex http://arbat.or.at/alprazolam/#alprazolam http://arbat.or.at/ambien/#ambien http://arbat.or.at/ativan/#ativan http://arbat.or.at/bontril/#bontril http://arbat.or.at/texas-holdem/#texas-holdem http://arbat.or.at/tramadol/#tramadol http://arbat.or.at/ultram/#ultram http://arbat.or.at/valium/#valium http://arbat.or.at/viagra/#viagra http://arbat.or.at/vicodin/#vicodin http://arbat.or.at/xanax/#xanax http://arbat.or.at/butalbital/#butalbital http://arbat.or.at/carisoprodol/ http://arbat.or.at/cialis/#cialis http://arbat.or.at/clonazepam/#clonazepam http://arbat.or.at/diazepam/#diazepam http://arbat.or.at/didrex/#didrex http://arbat.or.at/lorazepam/#cheap http://arbat.or.at/online-pharmacy/#online http://arbat.or.at/phentermine/#phentermine http://arbat.or.at/poker-room/#poker-room-online http://arbat.or.at/fioricet/#fioricet http://arbat.or.at/hydrocodone/#hydrocodone http://arbat.or.at/ionamin/#ionamine http://arbat.or.at/klonopin/#klonopin http://arbat.or.at/lorcet/#lorcet http://arbat.or.at/lortab/#lortab http://arbat.or.at/fastin/#fastin http://arbat.or.at/rivotril/#rivotril http://arbat.or.at/soma/#soma http://arbat.or.at/stilnox/#stilnox http://arbat.or.at/tenuate/#tenuate http://arbat.or.at/carisoma/#carisoma http://arbat.or.at/zolpidem/#zolpidem http://phenblonews.net/#wheight-loss-phentermine http://phennewsblo.com/#adipex-phentermine http://pax-blogs.info/#paxil http://phe-blogs.info/#phentermine-drug http://pr-blogs.info/#prozac-us http://pla-blogs.info/#plavix http://pro-blogs.info/#prozac http://nor-blogs.info/#norvax-online http://red-blogs.info/ http://val-blogs.info/#valium-order http://via-blogs.info/#viagra-cialis http://xen-blogs.info/#xenical-online http://xan-blogs.info/#buy-xanax http://arbat.or.at/boxing-betting/#boxing-betting http://peoplegrad.gen.in/ad/#onlineadipex http://peoplegrad.gen.in/allam/#onlinealprazolam http://peoplegrad.gen.in/ambi/#onlineambien http://peoplegrad.gen.in/avan/#cheapativan http://peoplegrad.gen.in/bont/#cheapbontril http://peoplegrad.gen.in/cilis/#cheapcialis http://peoplegrad.gen.in/clon/#clonazepambuy http://peoplegrad.gen.in/dize/#diazepambuy http://peoplegrad.gen.in/dix/#didrexpharmacy http://peoplegrad.gen.in/hycod/#hydrocodonevicodine http://peoplegrad.gen.in/lorz/#lorazepamorder http://peoplegrad.gen.in/pha/#onlinepharmacy http://peoplegrad.gen.in/fent/#phenterminepills http://peoplegrad.gen.in/trad/#tramadolultram http://peoplegrad.gen.in/valm/#valium-diazepam http://peoplegrad.gen.in/vgra/#viagra-buy-online http://peoplegrad.gen.in/naxan/#xanax-alprazolam-buy From mathimagics at yahoo.co.uk Sun Jul 2 14:30:41 2006 From: mathimagics at yahoo.co.uk (Jim White) Date: Sun, 2 Jul 2006 13:30:41 +0100 (BST) Subject: Looks like we got spammed! In-Reply-To: Message-ID: <20060702123041.44416.qmail@web86802.mail.ukl.yahoo.com> > 1. Visit this sites! (glumor at faza.ru) > 2. Visit this sites! (glumor at faza.ru) > 3. Visit this sites! (glumor at faza.ru) GMP + Viagara, ideal for solving those large scale Travelling Salesman Erection problems! :-) From daniellord at mac.com Sun Jul 2 17:06:08 2006 From: daniellord at mac.com (Daniel Lord) Date: Sun, 2 Jul 2006 08:06:08 -0700 Subject: Looks like we got spammed! In-Reply-To: <20060702123041.44416.qmail@web86802.mail.ukl.yahoo.com> References: <20060702123041.44416.qmail@web86802.mail.ukl.yahoo.com> Message-ID: <9E226E71-26EC-4939-9388-5CB92230B370@mac.com> I believe you are are mistaken: I heard it is needed to finish the Eight Queens. Daniel Lord --- "You will never regret getting up too early, and you'll always regret getting up too late, but sometimes you may regret giving up too late." -- Mountaineer's Adage On Jul 2, 2006, at 5:30, Jim White wrote: > >> 1. Visit this sites! (glumor at faza.ru) >> 2. Visit this sites! (glumor at faza.ru) >> 3. Visit this sites! (glumor at faza.ru) > > GMP + Viagara, ideal for solving those large scale > Travelling Salesman Erection problems! :-) > > > _______________________________________________ > gmp-discuss mailing list > gmp-discuss at swox.com > https://gmplib.org/mailman/listinfo/gmp-discuss From orangepi77 at yahoo.com Mon Jul 3 13:23:03 2006 From: orangepi77 at yahoo.com (peter) Date: Mon, 3 Jul 2006 04:23:03 -0700 (PDT) Subject: GMP "wrapper dll" for visual basic 6 Message-ID: <20060703112303.77457.qmail@web32703.mail.mud.yahoo.com> in Tue, 3 Jun 2003 a letter entitled Win32 GMP Port (notes for VB, Delphi, Pascal, PowerBasic, etc) by White, Jim http://www.swox.com/list-archives/gmp-discuss/2003-June/000515.html said that we could call a deltatrinity's "ready-rolled" Win32 GMP DLL's by using a "wrapper DLL" written in PowerBasic he gave an example: TYPE MPF mp_prec AS LONG mp_size AS LONG mp_expt AS LONG mp_limb AS LONG END TYPE DECLARE SUB cMPFinit CDECL LIB "libgmp-3.dll" ALIAS "__gmpf_init" (X AS MPF) DECLARE SUB cMPFclear CDECL LIB "libgmp-3.dll" ALIAS "__gmpf_clear" (X AS MPF) SUB MPFinit(x AS MPF) EXPORT CALL cMPFinit(x) END SUB SUB MPFclear(x AS MPF) EXPORT CALL cMPFclear(x) END SUB can someone please give more details about that, i wish to call GMP from VB6, just please a one just one simplest example on how to add two numbers by calling this "wrapper dll" from vb6 i have made the above dll using powerbasic and put it in a directory with libgmp-3.dll and libgmp-3.lib but VB6 can't add a reference to this dll. what should i do, thanks peter --------------------------------- Want to be your own boss? Learn how on Yahoo! Small Business. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060703/40de0abf/attachment.html From tege at swox.com Mon Jul 3 14:23:15 2006 From: tege at swox.com (Torbjorn Granlund) Date: 03 Jul 2006 14:23:15 +0200 Subject: Looks like we got spammed! In-Reply-To: <20060702123041.44416.qmail@web86802.mail.ukl.yahoo.com> References: <20060702123041.44416.qmail@web86802.mail.ukl.yahoo.com> Message-ID: <861wt2and8.fsf@king.swox.se> Jim White writes: > 1. Visit this sites! (glumor at faza.ru) > 2. Visit this sites! (glumor at faza.ru) > 3. Visit this sites! (glumor at faza.ru) GMP + Viagara, ideal for solving those large scale Travelling Salesman Erection problems! :-) Dear glumor is probably a program, it subscribed a week ago to all the gmp lists and then sent 3 spams to each list. Fortunately, only gmp-discuss allows new members to send messages; for the other lists we set the moderate flag for new members. If this becomes common, I'll change gmp-discuss to work like the other lists. -- Torbj?rn From mathimagics at yahoo.co.uk Tue Jul 4 14:14:28 2006 From: mathimagics at yahoo.co.uk (Jim White) Date: Tue, 4 Jul 2006 13:14:28 +0100 (BST) Subject: VB6/GMP via PowerBasic Wrapper DLL In-Reply-To: Message-ID: <20060704121428.18138.qmail@web86806.mail.ukl.yahoo.com> > we could call deltatrinity's "ready-rolled" Win32 > GMP DLL's by using a "wrapper DLL" written in > PowerBasic he gave an example: > TYPE MPF > mp_prec AS LONG > mp_size AS LONG > mp_expt AS LONG > mp_limb AS LONG > END TYPE > > DECLARE SUB cMPFinit CDECL LIB > "libgmp-3.dll" ALIAS "__gmpf_init" (X > AS MPF) > > DECLARE SUB cMPFclear CDECL LIB "libgmp-3.dll" > ALIAS "__gmpf_clear" (X > AS MPF) > > SUB MPFinit(x AS MPF) EXPORT > CALL cMPFinit(x) > END SUB > > SUB MPFclear(x AS MPF) EXPORT > CALL cMPFclear(x) > END SUB > i have made the above dll using powerbasic and put > it in a directory with libgmp-3.dll and libgmp-3.lib > but VB6 can't add a reference to this dll. Hi Peter 1. "VB6 can't add a reference" When making API calls (ie: calls to DLL functions declared with VB6 "Declare"), you do NOT try to get VB6 to add a reference to that DLL. The "DLL reference" mechanism is for importing Type Libraries, and has nothing to do with the GMP interface. 2. Before I give the correct VB6 syntax, I should point out that by default PB exports functions by their declared name mapped to UpperCase. So the sample above would export its functions as MPFCLEAR and MPFINIT. You can specify a case-sensitive name of your choosing with the ALIAS clause (ie: ALIAS can specify import names and also export names). Say you wanted to use the standard GMP function names in your VB6 client (which is a good idea in general). The PB code would look like this: SUB MPFinit Alias "mpf_init" (x AS MPF) EXPORT CALL cMPFinit(x) END SUB SUB MPFclear Alias "mpf_clear" (x AS MPF) EXPORT CALL cMPFclear(x) END SUB Assuming your VB6 client declares the MPF type exactly as above in the PB sample code, then, if the PB dll name is "pbgmp.dll", say, the VB6 client declares the functions like this: Declare Sub mpf_init lib "pbgmp.dll" (X As MPF) Declare Sub mpf_clear lib "pbgmp.dll" (X As MPF) Since I have used the exact names here that I used in the PB dll's ALIAS clauses, I don't need to use "Alias" in the VB6 code. Alternatively, the PB DLL compiled without ALIAS clauses could be called from VB6 with these declarations. As I said, if PB doesn't see an ALIAS clause it will export the function as UCASE(declared name): Declare Sub mpf_init Alias "MPFINIT" _ lib "pbgmp.dll" (X As MPF) Declare Sub mpf_clear Alias "MPFCLEAR" _ lib "pbgmp.dll" (X As MPF) Cheers Jim White ANU From xiangtaooo at gmail.com Wed Jul 5 10:27:25 2006 From: xiangtaooo at gmail.com (Tao Xiang) Date: Wed, 5 Jul 2006 16:27:25 +0800 Subject: How to create lib files Message-ID: <2a5f2c0a0607050127l1f7c5694hfc43a08b925acd1d@mail.gmail.com> I already used Cygwin to build GMP4.2.1 and install it. But I can only find libgmp.o. How can I convert it to gmp.lib beacuase I need to use GMP in VC6.0? Please give me a detailed explanation as I know little about Linux. Thanks. From orangepi77 at yahoo.com Wed Jul 5 14:27:09 2006 From: orangepi77 at yahoo.com (peter) Date: Wed, 5 Jul 2006 05:27:09 -0700 (PDT) Subject: VB6/GMP via PowerBasic Wrapper DLL Message-ID: <20060705122709.78512.qmail@web32706.mail.mud.yahoo.com> hi thanks for the reply, i am still trying to run just the mpf_init from VB6 i have compiled the following lines into the pbgmp.dll: the pb compiler v8.x does not issue errors: #COMPILE DLL "pbgmp" TYPE MPF mp_prec AS LONG mp_size AS LONG mp_expt AS LONG mp_limb AS LONG END TYPE DECLARE SUB cMPFinit CDECL LIB "libgmp-3.dll" ALIAS "__gmpf_init" (X AS MPF) DECLARE SUB cMPFclear CDECL LIB "libgmp-3.dll" ALIAS "__gmpf_clear" (X AS MPF) SUB MPFinit ALIAS "mpf_init" (x AS MPF) EXPORT CALL cMPFinit(x) END SUB SUB MPFclear ALIAS "mpf_clear" (x AS MPF) EXPORT CALL cMPFclear(x) END SUB and put the pbgmp.dll with libgmp-3.dll and VB6 code in the same folder: i run VB6 and write the following in a Module1.bas: Type MPF mp_prec As Long mp_size As Long mp_expt As Long mp_limb As Long End Type Declare Sub mpf_init Lib "pbgmp.dll" (x As MPF) Declare Sub mpf_clear Lib "pbgmp.dll" (x As MPF) and in the Form : Private Sub Command1_Click() Dim n As MPF mpf_init (n) End Sub but VB6 will issue the error message: variable required - can't assign to this expression, highlighing the (n) in mpf_init (n) whats wrong? i have looked at a code in the PurBasic forum: http://www.purebasic.fr/english/viewtopic.php?t=10776&start=0&postdays=0&postorder=asc&highlight=&sid=1dc7bfe4a44f32ac9dcfb11f57ab8a80 there is a successfull code to call the GMP dll about in the half part of the long page, i have tried it successfully, the call to GMP dll is directly without a wrapper. some of the first parts of the code: Structure mpf ; multiprecision floating point mp_prec.l mp_size.l mp_expt.l mp_limb.l EndStructure x.mpf y.mpf z.mpf CallFunction(1,"__gmpf_init2",x,256); initialize float number x with 256 bits precision but i am still have a desire to Call GMP functions from VB6 , there are still millions of people who are using it for its simple, rapid and friendly way please any suggestions, thanks very much --------------------------------- Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060705/aa8e97b7/attachment.html From evas at mountaincable.net Wed Jul 5 20:51:38 2006 From: evas at mountaincable.net (Chris Saunders) Date: Wed, 5 Jul 2006 14:51:38 -0400 Subject: How to create lib files In-Reply-To: <2a5f2c0a0607050127l1f7c5694hfc43a08b925acd1d@mail.gmail.com> Message-ID: <003001c6a064$0e9bc0a0$6500a8c0@mycomputer> Hi Tao, I believe you need to search for a file called libgmp.a under /usr/local/lib. Since you are using Cygwin, I think you also need to include cygwin.dll in your VC6 projects. There is an alternative. Build GMP using MinGW and MSYS. You can easily find them using Google. That way you only need to include libgmp.a and gmp.h in your VC6 projects. I'll include my personal email below so that you can email me personally if you have further questions as this discussion may not be appropriate for this list. Regards, Chris Saunders evas at mountaincable.net -----Original Message----- From: gmp-discuss-bounces at swox.com [mailto:gmp-discuss-bounces at swox.com] On Behalf Of Tao Xiang Sent: Wednesday, July 05, 2006 4:27 AM To: gmp-discuss at swox.com Subject: How to create lib files I already used Cygwin to build GMP4.2.1 and install it. But I can only find libgmp.o. How can I convert it to gmp.lib beacuase I need to use GMP in VC6.0? Please give me a detailed explanation as I know little about Linux. Thanks. _______________________________________________ gmp-discuss mailing list gmp-discuss at swox.com https://gmplib.org/mailman/listinfo/gmp-discuss From sisyphus1 at optusnet.com.au Thu Jul 6 09:09:45 2006 From: sisyphus1 at optusnet.com.au (Sisyphus) Date: Thu, 6 Jul 2006 17:09:45 +1000 Subject: How to create lib files References: <003001c6a064$0e9bc0a0$6500a8c0@mycomputer> Message-ID: <01e101c6a0cb$2e04a760$0100a8c0@desktop> ----- Original Message ----- From: "Chris Saunders" . . > Build > GMP using MinGW and MSYS. You can easily find them using Google. That way > you only need to include libgmp.a and gmp.h in your VC6 projects. > I think you would normally construct an import lib for VC6 using VC6's 'lib.exe' and 'libgmp-3.dll.def': lib /out:libgmp-3.lib /def:libgmp-3.dll.def Then, in your VC6 projects, link to libgmp-3.lib rather than libgmp.a. IIRC, if you want to link your VC6 projects to libgmp.a, you need to also link them to libgcc.a. See the " MS Windows DLLs" section at http://swox.com/gmp/manual/Notes-for-Particular-Systems.html#Notes-for-Particular-Systems Cheers, Rob From evas at mountaincable.net Thu Jul 6 11:05:14 2006 From: evas at mountaincable.net (Chris Saunders) Date: Thu, 6 Jul 2006 05:05:14 -0400 Subject: How to create lib files In-Reply-To: <01e101c6a0cb$2e04a760$0100a8c0@desktop> References: <003001c6a064$0e9bc0a0$6500a8c0@mycomputer> <01e101c6a0cb$2e04a760$0100a8c0@desktop> Message-ID: <000301c6a0db$4ba9d0a0$e2fd71e0$@net> I think that libgcc.a is only needed if you build using alloca - if you use malloc-reentrant (going from memory so the spelling may be incorrect) things should work fine. Regards Chris Saunders -----Original Message----- From: gmp-discuss-bounces at swox.com [mailto:gmp-discuss-bounces at swox.com] On Behalf Of Sisyphus Sent: July-06-06 3:10 AM To: 'Tao Xiang'; gmp-discuss at swox.com Subject: Re: How to create lib files ----- Original Message ----- From: "Chris Saunders" . . > Build > GMP using MinGW and MSYS. You can easily find them using Google. > That way > you only need to include libgmp.a and gmp.h in your VC6 projects. > I think you would normally construct an import lib for VC6 using VC6's 'lib.exe' and 'libgmp-3.dll.def': lib /out:libgmp-3.lib /def:libgmp-3.dll.def Then, in your VC6 projects, link to libgmp-3.lib rather than libgmp.a. IIRC, if you want to link your VC6 projects to libgmp.a, you need to also link them to libgcc.a. See the " MS Windows DLLs" section at http://swox.com/gmp/manual/Notes-for-Particular-Systems.html#Notes-for-Parti cular-Systems Cheers, Rob _______________________________________________ gmp-discuss mailing list gmp-discuss at swox.com https://gmplib.org/mailman/listinfo/gmp-discuss From degski at gmail.com Thu Jul 6 12:10:10 2006 From: degski at gmail.com (Degski) Date: Thu, 6 Jul 2006 12:10:10 +0200 Subject: How to create lib files Message-ID: <97e7bf7c0607060310r19adb91cv22444415e0f2f76d@mail.gmail.com> >From SWI-Prolog Windows (gmp) build instructions (www.swi-prolog.org), the part that relates to alloca: Quote: Now you have a static version of the library for MinGW in .libs/libgmp.a. Only, this uses alloca() which is provided by libgcc.a. We want alloca() as it is faster and avoids memory fragmentation. So: * Find libgcc.a using % gcc -print-libgcc-file-name * Find the file defining alloca() using the command below. For me this was _chkstk.o. Guess that is pretty stable. % nm -o `gcc -print-libgcc-file-name` | grep alloca * Now merg _chkstk.o into our library: % ar x `gcc -print-libgcc-file-name` _chkstk.o % cp .libs/libgmp.a gmp.a % ar q gmp.a _chkstk.o % ranlib gmp.a % mv gmp.a gmp.lib Done! You can use gmp.h and gmp.lib in an MSVC project. End Quote. This completes the info provided earlier. From mathimagics at yahoo.co.uk Fri Jul 7 03:45:02 2006 From: mathimagics at yahoo.co.uk (Jim White) Date: Fri, 7 Jul 2006 02:45:02 +0100 (BST) Subject: VB6/GMP via PowerBasic Wrapper DLL In-Reply-To: Message-ID: <20060707014502.4205.qmail@web86809.mail.ukl.yahoo.com> > mpf_init (n) In VB6, you should use either of the following forms: Call mpf_init(n) mpf_init n If you omit the Call keyword, you don't parenthesise the argument list. If you do parenthesise, VB then assumes you want that expression evaluated, hence the error message. > i have looked at a code in the PurBasic > forum: > http://www.purebasic.fr/english/viewtopic.php?t=10776&start=0&postdays=0&postorder=asc&highlight=&sid=1dc7bfe4a44f32ac9dcfb11f57ab8a80 > CallFunction(1,"__gmpf_init2",x,256); initialize I don't know anything about PureBasic, that's a new one for me, but given the syntax above I can guess what they are doing. I have a similar function, in fact, called "CallANY". It's a generic "call any DLL function without declaration" service, allowing you to bypass the VB6 Declare/Call mechanism entirely. Bear in mind this sort of tweak also bypasses all the normal error detection and recovery mechanisms you get when you stick to the standard syntax. For example, a "CallANY" approach can't give you any clues at compile time as to whether your target function name is valid, or if your argument list makes any sense. At run-time minor errors can easily result in crashes. If you know what you're doing, though, it's a powerful mechanism, particularly in relation to the generic STDCALL vs CDECL mechanism. That's because you can give CallANY a flag at runtime to tell it to use CDECL (ie. to clean up the stack after the call). My recommendation, however, is that compile-time checking is still worth retaining, and the PowerBasic wrapper DLL remains the best solution, IMHO. I can provide you with my current PowerBasic DLL, which already has a good range of ready-to-use GMP mpz and mpf functions (and is easily extended). I can also give you the coresponding VB6 include file (with the DECLARE's). Another advantage of this approach is that you can use the PowerBasic dll to modify the calling interface, or provide intermediate-level functions. I can also provide a copy of my CallANY DLL (it's written in MASM) if you still want to try that approach. Cheers Jim White ANU, Canberra From paulo.dutra at xilinx.com Thu Jul 13 02:28:31 2006 From: paulo.dutra at xilinx.com (Paulo Dutra) Date: Wed, 12 Jul 2006 17:28:31 -0700 Subject: Compile problems on WinXP with Cygwin shell Message-ID: <10316EE737CE8047BE0ED4E646CE4118043116F4@XSJ-EXCHVS1.xlnx.xilinx.com> I'm compiling the 4.2.1 release on WinXP with Cygwin shell. I'm using the MinGw compiler $ gcc -dumpversion 3.4.2 I get the following problem in compilation. make[2]: Entering directory `/cygdrive/c/gmp/gmp-4.2.1/mpn' /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHI N_GMP -I.. -DOPERATION_`echo divis | sed 's/_$//'` -m32 -O2 -fomit-frame-poin ter -mtune=pentium3 -march=pentium3 -c -o divis.lo divis.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_divis -m32 -O2 -fomit-frame-pointer -mtune=pentium3 -march=pentium3 -c divis.c -o divis.o divis.c: In function `__gmpn_divisible_p': divis.c:76: error: `TMP_DECL' undeclared (first use in this function) divis.c:76: error: (Each undeclared identifier is reported only once divis.c:76: error: for each function it appears in.) divis.c:141: error: `TMP_MARK' undeclared (first use in this function) divis.c:154: error: `TMP_FREE' undeclared (first use in this function) I notice that the TMP_DECL is defined in gmp-impl.h. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060713/499103ea/attachment.html From glassymeow at yahoo.com Thu Jul 13 13:18:30 2006 From: glassymeow at yahoo.com (glassy) Date: Thu, 13 Jul 2006 04:18:30 -0700 (PDT) Subject: about precision and format Message-ID: <20060713111830.17789.qmail@web56309.mail.re3.yahoo.com> two questions: in the GMP manual : mpf_set_default_prec (unsigned long int prec) : sets the default precision to be at least prec bits. okay if we want the precision 2048 bits, how may digits will be at the right of the mantissa if we want a decimal number ? second question: in the gmp_sprintf(s, "%77.72Fe" , @r) what is the meaning of the format string "%77.72Fe" how could we interpret it. and also gmp_sprintz(s, "%Zd" , @r) how could we intepret the string "%Zd" thanks glassy --------------------------------- Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail Beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060713/be35ceb9/attachment.html From decio at decpp.net Thu Jul 13 19:57:19 2006 From: decio at decpp.net (=?ISO-8859-1?Q?D=E9cio_Luiz_Gazzoni_Filho?=) Date: Thu, 13 Jul 2006 14:57:19 -0300 Subject: about precision and format In-Reply-To: <20060713111830.17789.qmail@web56309.mail.re3.yahoo.com> References: <20060713111830.17789.qmail@web56309.mail.re3.yahoo.com> Message-ID: <2AF09301-1536-4E91-95C3-45730D74221C@decpp.net> On Jul 13, 2006, at 8:18 AM, glassy wrote: > two questions: > in the GMP manual : > mpf_set_default_prec (unsigned long int prec) : sets the default > precision to be at least prec bits. > okay if we want the precision 2048 bits, how may digits will be at > the right of the mantissa if we want a decimal number ? 2048*log10(2) = 616.51 digits. > second question: in the gmp_sprintf(s, "%77.72Fe" , @r) what is > the meaning of the format string "%77.72Fe" how could we > interpret it. > and also gmp_sprintz(s, "%Zd" , @r) how could we intepret the > string "%Zd" This is described in the manual: http://www.swox.com/gmp/manual/Formatted-Output-Strings.html D?cio -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://gmplib.org/list-archives/gmp-discuss/attachments/20060713/3422df0e/PGP.bin From alex_vilch at yahoo.com Fri Jul 14 23:52:19 2006 From: alex_vilch at yahoo.com (Alex Vilchenko) Date: Fri, 14 Jul 2006 14:52:19 -0700 (PDT) Subject: GMP and MINGW Message-ID: <20060714215219.14467.qmail@web36211.mail.mud.yahoo.com> Has anyone tried to use GMP for Windows mingw ? http://www.mingw.org/ I was able to compile gmp-4.2.1 under mingw. However when I try to link with -lgmp to compile a simple c++ program using gmp calls I'm getting the number of undefined references like __gmpz_init and __gmpz_set_str. I can not find those in GMP library. Thank you, Alex. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From tege at swox.com Sat Jul 15 17:05:12 2006 From: tege at swox.com (Torbjorn Granlund) Date: 15 Jul 2006 17:05:12 +0200 Subject: GMP and MINGW In-Reply-To: <20060714215219.14467.qmail@web36211.mail.mud.yahoo.com> References: <20060714215219.14467.qmail@web36211.mail.mud.yahoo.com> Message-ID: <86wtae3o47.fsf@king.swox.se> Alex Vilchenko writes: Has anyone tried to use GMP for Windows mingw ? http://www.mingw.org/ I was able to compile gmp-4.2.1 under mingw. However when I try to link with -lgmp to compile a simple c++ program using gmp calls I'm getting the number of undefined references like __gmpz_init and __gmpz_set_str. I can not find those in GMP library. You will save a lot of time and bandwidth if you read some pages of the fine manual. -- Torbj?rn From glassymeow at yahoo.com Sun Jul 16 13:52:21 2006 From: glassymeow at yahoo.com (glassy) Date: Sun, 16 Jul 2006 04:52:21 -0700 (PDT) Subject: compiling the billions of Pi digits.c file Message-ID: <20060716115221.3776.qmail@web56314.mail.re3.yahoo.com> how to compile and build the file "gmp-chudnovsky.c" in the http://swox.com/gmp/pi-with-gmp.html i am not a programmer, just a user, i hope someone could give a detailed insructions. i have failed in compiling the file using VC++ v6.0 under winows xp glassy --------------------------------- Yahoo! Music Unlimited - Access over 1 million songs.Try it free. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060716/c545e29b/attachment.html From cucuforcoffee at gmail.com Sun Jul 16 21:37:24 2006 From: cucuforcoffee at gmail.com (Nameless Apprentice) Date: Sun, 16 Jul 2006 15:37:24 -0400 Subject: GMP, C++ formatted output Message-ID: Hi, I plan to use the GMP library and am in need of representing the values as strings for use with MPI. I require a string representation of an mpf_class that has the same number of characters, always. That is, the trailing zeros can not be dropped even though they are not part of the actual accuracy. For instance, 3 characters for the exponents in base 10, and always the same number of characters for expressing the mantissa and one for sign. Do any of you know how to accomplish this or if there is already a function or utility for doing so? Thanks, Marc. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060716/f424b494/attachment.html From sisyphus1 at optusnet.com.au Mon Jul 17 09:10:51 2006 From: sisyphus1 at optusnet.com.au (Sisyphus) Date: Mon, 17 Jul 2006 17:10:51 +1000 Subject: compiling the billions of Pi digits.c file References: <20060716115221.3776.qmail@web56314.mail.re3.yahoo.com> Message-ID: <007401c6a970$2868b5a0$0100a8c0@desktop> ----- Original Message ----- From: "glassy" > how to compile and build the file "gmp-chudnovsky.c" > in the http://swox.com/gmp/pi-with-gmp.html > i am not a programmer, just a user, i hope someone could give a detailed insructions. > i have failed in compiling the file using VC++ v6.0 under winows xp It builds ok with the MinGW (native windows) port of the gcc compiler on Win32, but when I try to build with VC7.0, I get the following warnings/errors during compilation: gmp-chudnovsky.c(176) : warning C4005: 'min' : macro redefinition F:\vsnet\Vc7\include\stdlib.h(415) : see previous definition of 'min' gmp-chudnovsky.c(177) : warning C4005: 'max' : macro redefinition F:\vsnet\Vc7\include\stdlib.h(414) : see previous definition of 'max' gmp-chudnovsky.c(211) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(212) : error C2085: 'fac_reset' : not in formal parameter list gmp-chudnovsky.c(212) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(217) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(218) : error C2085: 'fac_init_size' : not in formal parameter list gmp-chudnovsky.c(218) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(230) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(231) : error C2085: 'fac_init' : not in formal parameter list gmp-chudnovsky.c(231) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(236) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(237) : error C2085: 'fac_clear' : not in formal parameter list gmp-chudnovsky.c(237) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(242) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(243) : error C2085: 'fac_resize' : not in formal parameter list gmp-chudnovsky.c(243) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(252) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(253) : error C2085: 'fac_set_bp' : not in formal parameter list gmp-chudnovsky.c(253) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(266) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(267) : error C2085: 'fac_mul2' : not in formal parameter list gmp-chudnovsky.c(267) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(299) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(300) : error C2085: 'fac_mul' : not in formal parameter list gmp-chudnovsky.c(300) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(311) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(312) : error C2085: 'fac_mul_bp' : not in formal parameter list gmp-chudnovsky.c(312) : error C2143: syntax error : missing ';' before '{' gmp-chudnovsky.c(319) : error C2054: expected '(' to follow 'inline' gmp-chudnovsky.c(320) : error C2085: 'fac_compact' : not in formal parameter list gmp-chudnovsky.c(320) : error C2143: syntax error : missing ';' before '{' I think these errors all stem from the fact that VC7.0 (and, I assume, VC6.0) expect a '(' to follow 'inline'. I don't know, offhand, how to rewrite that code in such a way that Microsoft compilers will find it acceptable ... and it's something that's off-topic for this list. Perhaps some kind soul who knows the answer will tell you anyway :-) Otherwise you could ask for advice on how to handle this situation at (eg) the comp.os.ms-windows.programmer.misc newsgroup where (I think) such questions *are* on topic. If the error you get is significantly different to the above, then it might be best to let us know just what the error is. Cheers, Rob From brg at gladman.plus.com Mon Jul 17 10:49:42 2006 From: brg at gladman.plus.com (Brian Gladman) Date: Mon, 17 Jul 2006 09:49:42 +0100 Subject: compiling the billions of Pi digits.c file In-Reply-To: <007401c6a970$2868b5a0$0100a8c0@desktop> References: <20060716115221.3776.qmail@web56314.mail.re3.yahoo.com> <007401c6a970$2868b5a0$0100a8c0@desktop> Message-ID: <44BB4F26.9050204@gladman.plus.com> Sisyphus wrote: > ----- Original Message ----- > From: "glassy" > >> how to compile and build the file "gmp-chudnovsky.c" >> in the http://swox.com/gmp/pi-with-gmp.html >> i am not a programmer, just a user, i hope someone could give a detailed > insructions. >> i have failed in compiling the file using VC++ v6.0 under winows xp > > It builds ok with the MinGW (native windows) port of the gcc compiler on > Win32, but when I try to build with VC7.0, I get the following > warnings/errors during compilation: > I think these errors all stem from the fact that VC7.0 (and, I assume, > VC6.0) expect a '(' to follow 'inline'. I don't know, offhand, how to > rewrite that code in such a way that Microsoft compilers will find it > acceptable ... and it's something that's off-topic for this list. Perhaps > some kind soul who knows the answer will tell you anyway :-) > Otherwise you could ask for advice on how to handle this situation at (eg) > the comp.os.ms-windows.programmer.misc newsgroup where (I think) such > questions *are* on topic. > > If the error you get is significantly different to the above, then it might > be best to let us know just what the error is. The only change I needed to make to gmp-chudnovsky.c to use it with my native VC++ port of GMP was to add: #ifdef _MSC_VER #define inline __inline #endif after the included header files to overcome the use of a 'inline' which, I think, is non standard in C prior to C99. Brian Gladman From jwf830 at gmail.com Tue Jul 18 04:29:57 2006 From: jwf830 at gmail.com (Jiang wf) Date: Tue, 18 Jul 2006 04:29:57 +0200 Subject: how to set gmp environment in a SGI origin 3800 Message-ID: <82e8282d0607171929h312e1b63vbda9487523bb8a5c@mail.gmail.com> hello, I have install gmp4.2.1 in my user directory, but how to set environmnet so that the "include" and "lib" in my home directory can be used for compile and run the gmp code. I have tried to set LD_LIBRARY_PATH, but seems not working... Thanks for any help! saga -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060718/123db6b9/attachment.html From tege at swox.com Tue Jul 18 13:39:56 2006 From: tege at swox.com (Torbjorn Granlund) Date: 18 Jul 2006 13:39:56 +0200 Subject: GMP, C++ formatted output In-Reply-To: References: Message-ID: <86irlv3zw3.fsf@king.swox.se> "Nameless Apprentice" writes: For instance, 3 characters for the exponents in base 10, and always the same number of characters for expressing the mantissa and one for sign. Do any of you know how to accomplish this or if there is already a function or utility for doing so? I suppose you need to write a simple interface to mpf_get_str. -- Torbj?rn From decio at decpp.net Thu Jul 20 17:20:33 2006 From: decio at decpp.net (=?ISO-8859-1?Q?D=E9cio_Luiz_Gazzoni_Filho?=) Date: Thu, 20 Jul 2006 12:20:33 -0300 Subject: GMP, C++ formatted output In-Reply-To: <86irlv3zw3.fsf@king.swox.se> References: <86irlv3zw3.fsf@king.swox.se> Message-ID: <68CDC7C2-2638-4E66-96E2-00046FB924B2@decpp.net> On Jul 18, 2006, at 8:39 AM, Torbjorn Granlund wrote: > "Nameless Apprentice" writes: > > For instance, 3 characters for the exponents in base 10, and > always the same > number of characters for expressing the mantissa and one for > sign. Do any of > you know how to accomplish this or if there is already a function > or utility > for doing so? > > I suppose you need to write a simple interface to mpf_get_str. Correct me if I'm wrong, but gmp_printf() with the right flags should do the job as well. D?cio -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://gmplib.org/list-archives/gmp-discuss/attachments/20060720/311fb36f/attachment.bin From wstein at gmail.com Thu Jul 27 00:11:49 2006 From: wstein at gmail.com (William Stein) Date: Wed, 26 Jul 2006 15:11:49 -0700 Subject: Intel OSX support Message-ID: <85e81ba30607261511l69c562caua72effe9aacd1da8@mail.gmail.com> Hello, As was discussed on this list in February (and in several other lists), GMP-4.2.* does not compile (as a shared library) with assembly support on Intel-based OS X computers. As far as I can tell from all subsequent discussions, nobody seems to have taken responsibility to address this problem, and the statement "[2006-05-04] GMP does not build on MacInteltosh machines. No fix planned." on the GMP website is not encouraging. So I'm trying to fix this problem myself, since I'm the main developer of SAGE (http://modular.math.washington.edu/sage), which makes extensive use of GMP, and we want SAGE to support OS X well (I mainly use Linux myself, but many SAGE users use OS X.) In the rest of this email all discussion involves using the *newest* *(this is important) version of XCode on an Intel based mac with the latest OS upgrades and gmp-4.2.1.tar.bz2 downloaded from the GMP site. (If you don't use the latest XCode, you'll likely have additional problems.) If we build GMP using ./configure --enable-cxx=yes --enable-shared --disable-static make then (as mentioned in previous posts) the compilation fails with errors that involves two small blocks of assembly code that have an invalid (for OS X) @ symbol in them: mpn/dive_1.asm, lines 79-88, and mpn/mode1o.s, lines 77-86, both which are this block of code: ifdef(`PIC',` call L(movl_eip_ebp) addl $_GLOBAL_OFFSET_TABLE_, %ebp movl modlimb_invert_table at GOT(%ebp), %ebp movzbl (%eax,%ebp), %ebp C inv 8 bits ',` dnl non-PIC movzbl modlimb_invert_table(%eax), %ebp C inv 8 bits ') These blocks involve whether or not PIC is defined. I read somewhere online that PIC should not be defined for OSX, so I completely commented out these two blocks of code (using dnl). The entire GMP build then completes successfully (and many many sample calculations I try work perfectly, and are VERY fast compared to the non-assembly version of GMP for OS X.) Doing "make check" there is exactly one failure (I realize this is just the make test in the tests/mpn directory, and there are many other tests that didn't get run). make check-TESTS PASS: t-asmtype PASS: t-aors_1 PASS: t-divrem_1 t-fat.c:132: GNU MP assertion failed: wp[0] == 321 FAIL: t-fat PASS: t-get_d PASS: t-instrument PASS: t-iord_u PASS: t-mp_bases PASS: t-perfsqr PASS: t-scan ================================== 1 of 10 tests failed Please report to gmp-bugs at swox.com This is perhaps not surprising, given that I commented out a line in the assembler code that inverts an integer -- of course GMP shouldn't work correctly with that line missing. If I put back the non-PIC versions, I get this error on compilation: ld: mpn/.libs/dive_1.o has external relocation entries in non-writable section (__TEXT,__text) for symbols: ___gmp_modlimb_invert_table /usr/bin/libtool: internal link edit command failed This is also exactly what I'd also get if I made no changes to the GMP source code, but gave the --with-pic=no option to configure. QUESTION: What should the line of assembler be to either correctly get that symbol, or to do the inversion (possibly without using the table)? -- William Stein Associate Professor of Mathematics University of Washington From wstein at gmail.com Thu Jul 27 17:31:15 2006 From: wstein at gmail.com (William Stein) Date: Thu, 27 Jul 2006 08:31:15 -0700 Subject: (Problem solved!) Re: Intel OSX support Message-ID: <85e81ba30607270831o52f6e089l29b5a54265957e1d@mail.gmail.com> Hi, I just wanted to follow up my previous email with the solution I found this morning. Since the only reason the GMP dylib with assembler support doesn't work on OS X Intel is because of the code in mpn/dive_1.asm and mpn/mode1o.asm, one solution is to simply use the C versions of the two functions defined in those files but use the assembler versions of everything else. Fortunately, the GMP build process makes it extremely easy to use C versions of functions instead of assembler versions. If I execute the commands listed below, I get a version of GMP built as a dynamic library with (most) special assembler support. It passes "make check" with no problems at all. And according to my benchmarks it is almost (but not quite) as fast (for what I do) as GMP compiled under Linux on the same machine -- i.e., it's about 3-4 times faster than compiling GMP with no assembly support on OS X. tar jxvf gmp-4.2.1.tar.bz2 cd gmp-4.2.1/mpn/x86 rm *dive_1* */*dive_1* */*/*dive_1* rm */*mode1o* */*/*mode1o* cd ../.. ./configure --enable-cxx=yes --enable-shared --disable-static make make check I hope this is helpful to people using Intel-based Macs. -- William (P.S. If you didn't read my previous post, I assume that one is using the latest version of XCode above. I don't know whether this will work or not with older versions.) From jp at justsoft.com.br Thu Jul 27 19:16:52 2006 From: jp at justsoft.com.br (=?ISO-8859-1?Q?Jo=E3o?= Paulo Just) Date: Thu, 27 Jul 2006 14:16:52 -0300 Subject: GMP and MIME-Base64 Message-ID: <20060727171652.5568.qmail@hm370.locaweb.com.br> Hello all. I'm currently using base 36 numbers to calculate with GMP: x = mpz_get_str(NULL, 36, n); But, according to the manual, base can be from 2 up to 62. I'd like to now if there is a way to get Base64 numbers from mpz_get_str() and also with mpz_set_str(). Thanks in advance. -- Jo?o Paulo Just Peixoto Justsoft Inform?tica e Publicidades Ltda. http://www.justsoft.com.br/ -- Ilh?us, BA, Brasil +55 75 8104 8473 From tg at swox.com Fri Jul 28 13:21:29 2006 From: tg at swox.com (Torbjorn Granlund) Date: 28 Jul 2006 13:21:29 +0200 Subject: GMP results for Woodcrest, Conroe, anyone? Message-ID: <86irliq8jq.fsf@king.swox.se> Does anyone on this list have an Intel Woodcrest or Conroe, aka "Core 2" that runs some sensible 64-bit operating system? It would be interesting to know how well it performs with GMP. While the new P6 incarnation clearly has great 32-bit performance, for GMP we almost only care about its 64-bit multiply throughput. -- Torbj?rn From kha at treskal.com Fri Jul 28 20:19:25 2006 From: kha at treskal.com (Karl =?iso-8859-1?Q?Hasselstr=F6m?=) Date: Fri, 28 Jul 2006 20:19:25 +0200 Subject: GMP results for Woodcrest, Conroe, anyone? In-Reply-To: <86irliq8jq.fsf@king.swox.se> References: <86irliq8jq.fsf@king.swox.se> Message-ID: <20060728181925.GA22542@diana.vm.bytemark.co.uk> On 2006-07-28 13:21:29 +0200, Torbjorn Granlund wrote: > It would be interesting to know how well it performs with GMP. While > the new P6 incarnation clearly has great 32-bit performance, for GMP > we almost only care about its 64-bit multiply throughput. Unless the 64-bit multiply throughput is more than 4 times as low as the 32-bit multiply throughput. But they wouldn't do that, would they? :-) -- Karl Hasselstr?m, kha at treskal.com www.treskal.com/kalle From tege at swox.com Fri Jul 28 20:27:05 2006 From: tege at swox.com (Torbjorn Granlund) Date: 28 Jul 2006 20:27:05 +0200 Subject: GMP results for Woodcrest, Conroe, anyone? In-Reply-To: <20060728181925.GA22542@diana.vm.bytemark.co.uk> References: <86irliq8jq.fsf@king.swox.se> <20060728181925.GA22542@diana.vm.bytemark.co.uk> Message-ID: <864px1y492.fsf@king.swox.se> Karl Hasselstr?m writes: On 2006-07-28 13:21:29 +0200, Torbjorn Granlund wrote: > It would be interesting to know how well it performs with GMP. While > the new P6 incarnation clearly has great 32-bit performance, for GMP > we almost only care about its 64-bit multiply throughput. Unless the 64-bit multiply throughput is more than 4 times as low as the 32-bit multiply throughput. But they wouldn't do that, would they? :-) Well, they've already done that... The Prescott P4 (and later) can sustain one 32x32->64 multiply every 2nd cycle, and one 64x64->128 multiply every 10th cycle. If Net rumours are to be believed, there are issues with 64-bit arithmetic performance also with the new P6. -- Torbj?rn From jwf830 at gmail.com Sat Jul 29 06:50:04 2006 From: jwf830 at gmail.com (Jiang wf) Date: Sat, 29 Jul 2006 06:50:04 +0200 Subject: problem with example of mpn_gcd Message-ID: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> hello, everyone, I just want use mpn_gcd to make a program, that can calculate gcd of two big integers, the following is my code named agcd.c: #include #include main (int argc, char **argv) { mpz_t a, b, p; if (argc != 3) { printf ("Usage: %s \n", argv[0]); exit (1); } /* Initialize and assign a and b from base 10 strings in argv */ mpz_init_set_str (a, argv[1], 10); mpz_init_set_str (b, argv[2], 10); /* Initialize p */ mpz_init (p); /* compute the gcd of a and b*/ mp_size_t mpn_gcd (mp_limb_t *p, mp_limb_t *a, mp_size_an, mp_limb_t *b, mp_size_t bn) /* Print p in base 10 */ mpz_out_str (stdout, 10, p); fputc ('\n', stdout); /* Since we're about to exit, no need to clear out variables */ exit (0); } and when compiled, got the following error: agcd.c: In function 'main': agcd.c:9: warning: incompatible implicit declaration of built-in function 'exit' agcd.c:20: error: syntax error before 'mp_size_an' so, please, anyone can give me some advise about this problem, thanks! weifeng Jiang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060729/20931dfe/attachment.html From decio at decpp.net Sat Jul 29 17:33:36 2006 From: decio at decpp.net (=?ISO-8859-1?Q?D=E9cio_Luiz_Gazzoni_Filho?=) Date: Sat, 29 Jul 2006 12:33:36 -0300 Subject: problem with example of mpn_gcd In-Reply-To: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> References: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> Message-ID: On Jul 29, 2006, at 1:50 AM, Jiang wf wrote: > hello, everyone, > > I just want use mpn_gcd to make a program, that can calculate gcd > of two big integers, the following is my code named agcd.c: > > > > #include > #include > > main (int argc, char **argv) > { > mpz_t a, b, p; > > if (argc != 3) > { printf ("Usage: %s \n", argv[0]); exit > (1); } > > /* Initialize and assign a and b from base 10 strings in argv */ > mpz_init_set_str (a, argv[1], 10); > mpz_init_set_str (b, argv[2], 10); > /* Initialize p */ > mpz_init (p); > > > /* compute the gcd of a and b*/ > mp_size_t mpn_gcd (mp_limb_t *p, mp_limb_t *a, > mp_size_an, mp_limb_t *b, mp_size_t bn) > > /* Print p in base 10 */ > mpz_out_str (stdout, 10, p); > fputc ('\n', stdout); > > /* Since we're about to exit, no need to clear out variables */ > exit (0); > } > > > > and when compiled, got the following error: > > agcd.c: In function 'main': > agcd.c:9: warning: incompatible implicit declaration of built-in > function 'exit' > agcd.c:20: error: syntax error before 'mp_size_an' > > > > > so, please, anyone can give me some advise about this problem, thanks! Well I can. Drop any pretenses of being a computer programmer and go be a manager or CEO somewhere. You don't have what it takes to be a programmer. And whether you follow my advice or not, do not post to this mailing list anymore. Your email nearly made me sick to my stomach. D?cio -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://gmplib.org/list-archives/gmp-discuss/attachments/20060729/fb361553/attachment.bin From laurent at komite.net Sat Jul 29 21:31:39 2006 From: laurent at komite.net (Laurent Fousse) Date: Sat, 29 Jul 2006 21:31:39 +0200 Subject: problem with example of mpn_gcd In-Reply-To: References: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> Message-ID: <20060729193139.GG1839@conuropsis.org> Hello, * D?cio Luiz Gazzoni Filho [Sat, Jul 29, 2006 at 12:33:36PM -0300]: > On Jul 29, 2006, at 1:50 AM, Jiang wf wrote: > >so, please, anyone can give me some advise about this problem, thanks! > > Well I can. Drop any pretenses of being a computer programmer and go > be a manager or CEO somewhere. You don't have what it takes to be a > programmer. > > And whether you follow my advice or not, do not post to this mailing > list anymore. Your email nearly made me sick to my stomach. While the basic C programming questions are off-topic on this list, I believe the tone of your reply is uncalled for. Laurent. From Paul.Zimmermann at loria.fr Sat Jul 29 21:59:36 2006 From: Paul.Zimmermann at loria.fr (Paul Zimmermann) Date: Sat, 29 Jul 2006 21:59:36 +0200 Subject: problem with example of mpn_gcd In-Reply-To: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> (jwf830@gmail.com) Message-ID: Use mpz_gcd instead of mpn_gcd. The mpn_ functions are for experts. Paul From wstein at gmail.com Sat Jul 29 20:29:19 2006 From: wstein at gmail.com (William Stein) Date: Sat, 29 Jul 2006 11:29:19 -0700 Subject: problem with example of mpn_gcd In-Reply-To: References: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> Message-ID: > On Jul 29, 2006, at 1:50 AM, Jiang wf wrote: >> hello, everyone, >> >> I just want use mpn_gcd to make a program, that can calculate gcd >> of two big integers, the following is my code named agcd.c: >> >> >> >> #include >> #include >> >> main (int argc, char **argv) >> { >> mpz_t a, b, p; >> >> if (argc != 3) >> { printf ("Usage: %s \n", argv[0]); exit >> (1); } >> >> /* Initialize and assign a and b from base 10 strings in argv */ >> mpz_init_set_str (a, argv[1], 10); >> mpz_init_set_str (b, argv[2], 10); >> /* Initialize p */ >> mpz_init (p); >> >> >> /* compute the gcd of a and b*/ >> mp_size_t mpn_gcd (mp_limb_t *p, mp_limb_t *a, >> mp_size_an, mp_limb_t *b, mp_size_t bn) >> >> /* Print p in base 10 */ >> mpz_out_str (stdout, 10, p); >> fputc ('\n', stdout); >> >> /* Since we're about to exit, no need to clear out variables */ >> exit (0); >> } >> >> >> >> and when compiled, got the following error: >> >> agcd.c: In function 'main': >> agcd.c:9: warning: incompatible implicit declaration of built-in >> function 'exit' >> agcd.c:20: error: syntax error before 'mp_size_an' >> >> >> >> >> so, please, anyone can give me some advise about this problem, thanks! You pasted in the declaration of some random function that had "gcd" in it instead of calling the correct gmp function. See below: #include #include main (int argc, char **argv) { mpz_t a, b, p; if (argc != 3) { printf ("Usage: %s \n", argv[0]); return 1; } /* Initialize and assign a and b from base 10 strings in argv */ mpz_init_set_str (a, argv[1], 10); mpz_init_set_str (b, argv[2], 10); /* Initialize p */ mpz_init (p); /* compute the gcd of a and b*/ mpz_gcd(p, a, b); /* Print p in base 10 */ mpz_out_str (stdout, 10, p); fputc ('\n', stdout); /* Since we're about to exit, no need to clear out variables */ return(0); } -- William Stein Associate Professor of Mathematics University of Washington From alan.mcfarlane at gmail.com Sat Jul 29 20:22:57 2006 From: alan.mcfarlane at gmail.com (Alan McFarlane) Date: Sat, 29 Jul 2006 19:22:57 +0100 Subject: problem with example of mpn_gcd In-Reply-To: References: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> Message-ID: <44CBA781.1070201@gmail.com> Try this code Jang... #include #include /* needed for exit() prototype */ #include int main (int argc, char **argv) { mpz_t a, b, p; if (argc != 3) { printf("Usage: %s \n", argv[0]); exit(1); } /* Initialize and assign a and b from base 10 strings in argv */ mpz_init_set_str(a, argv[1], 10); mpz_init_set_str(b, argv[2], 10); /* Initialize p */ mpz_init(p); /* compute the gcd of a and b*/ mpz_gcd(p, a, b); /* Print p in base 10 */ mpz_out_str(stdout, 10, p); fputc('\n', stdout); /* Since we're about to exit, no need to clear out variables */ /* But, we will do (force of habit!) */ mpz_clear(p); mpz_clear(b); mpz_clear(a); exit (0); } As for D?cio's comments, they make me ashamed to be a programmer. Everyone has to learn somewhere, and I'll bet we all make simple mistakes (at least to those with a bit more experience). Be nice D?cio :) -- Alan McFarlane D?cio Luiz Gazzoni Filho wrote: > > On Jul 29, 2006, at 1:50 AM, Jiang wf wrote: > >> hello, everyone, >> >> I just want use mpn_gcd to make a program, that can calculate gcd of >> two big integers, the following is my code named agcd.c: >> >> >> >> #include >> #include >> >> main (int argc, char **argv) >> { >> mpz_t a, b, p; >> >> if (argc != 3) >> { printf ("Usage: %s \n", argv[0]); exit (1); } >> >> /* Initialize and assign a and b from base 10 strings in argv */ >> mpz_init_set_str (a, argv[1], 10); >> mpz_init_set_str (b, argv[2], 10); >> /* Initialize p */ >> mpz_init (p); >> >> >> /* compute the gcd of a and b*/ >> mp_size_t mpn_gcd (mp_limb_t *p, mp_limb_t *a, >> mp_size_an, mp_limb_t *b, mp_size_t bn) >> >> /* Print p in base 10 */ >> mpz_out_str (stdout, 10, p); >> fputc ('\n', stdout); >> >> /* Since we're about to exit, no need to clear out variables */ >> exit (0); >> } >> >> >> >> and when compiled, got the following error: >> >> agcd.c: In function 'main': >> agcd.c:9: warning: incompatible implicit declaration of built-in >> function 'exit' >> agcd.c:20: error: syntax error before 'mp_size_an' >> >> >> >> >> so, please, anyone can give me some advise about this problem, thanks! > > Well I can. Drop any pretenses of being a computer programmer and go be > a manager or CEO somewhere. You don't have what it takes to be a > programmer. > > And whether you follow my advice or not, do not post to this mailing > list anymore. Your email nearly made me sick to my stomach. > > D?cio > > > > ------------------------------------------------------------------------ > > _______________________________________________ > gmp-discuss mailing list > gmp-discuss at swox.com > https://gmplib.org/mailman/listinfo/gmp-discuss From stangmechanic at gmail.com Sat Jul 29 20:55:37 2006 From: stangmechanic at gmail.com (Blake Huff) Date: Sat, 29 Jul 2006 13:55:37 -0500 Subject: problem with example of mpn_gcd In-Reply-To: References: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> Message-ID: <0B723226-83F9-48FB-B541-09C89F26C03B@gmail.com> Wow that was a rude response. Not ALL of us are natural born programmers, and most of us get in over our head at some point. Anyways, here's some examples of how to call the gmp functions from your code. Anyways, as Decio pointed out, these are rather elementary C issues, so I suggest you brush up on your programming before jumping into the GMP functions. There are certainly some lists for C learners. #include #include main (int argc, char **argv){ mpz_t a, b, p; if (argc != 3) { printf ("Usage: %s \n", argv[0]); return (1); } /* Initialize and assign a and b from base 10 strings in argv */ mpz_init_set_str (a, argv[1], 10); mpz_init_set_str (b, argv[2], 10); /* Initialize p */ mpz_init (p); /* compute the gcd of a and b*/ mpz_gcd(p, a, b); // mp_size_t mpn_gcd (mp_limb_t *p, mp_limb_t *a, // mp_size_an, mp_limb_t *b, mp_size_t bn) /* Print p in base 10 */ gmp_printf("%Zd\n", p); // mpz_out_str (stdout, 10, p); // fputc ('\n', stdout); /* Since we're about to exit, no need to clear out variables */ return (0); } On Jul 29, 2006, at 10:33 AM, D?cio Luiz Gazzoni Filho wrote: >> #include >> #include >> >> main (int argc, char **argv) >> { >> mpz_t a, b, p; >> >> if (argc != 3) >> { printf ("Usage: %s \n", argv[0]); exit >> (1); } >> >> /* Initialize and assign a and b from base 10 strings in >> argv */ >> mpz_init_set_str (a, argv[1], 10); >> mpz_init_set_str (b, argv[2], 10); >> /* Initialize p */ >> mpz_init (p); >> >> >> /* compute the gcd of a and b*/ >> mp_size_t mpn_gcd (mp_limb_t *p, mp_limb_t *a, >> mp_size_an, mp_limb_t *b, mp_size_t bn) >> >> /* Print p in base 10 */ >> mpz_out_str (stdout, 10, p); >> fputc ('\n', stdout); >> >> /* Since we're about to exit, no need to clear out variables */ >> exit (0); >> } Blake Huff stangmechanic at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20060729/f98031c9/attachment-0001.html From tege at swox.com Mon Jul 31 13:06:07 2006 From: tege at swox.com (Torbjorn Granlund) Date: 31 Jul 2006 13:06:07 +0200 Subject: GMP and MIME-Base64 In-Reply-To: <20060727171652.5568.qmail@hm370.locaweb.com.br> References: <20060727171652.5568.qmail@hm370.locaweb.com.br> Message-ID: <86r702owyo.fsf@king.swox.se> "Jo?o Paulo Just" writes: Hello all. I'm currently using base 36 numbers to calculate with GMP: x = mpz_get_str(NULL, 36, n); But, according to the manual, base can be from 2 up to 62. I'd like to now if there is a way to get Base64 numbers from mpz_get_str() and also with mpz_set_str(). Is Base64 defined for arbitrary precision integers? I doubt it is. If you just want output in base 64 (as opposed to Base64), mpz_export should be able to do it. -- Torbj?rn From linas at austin.ibm.com Mon Jul 31 20:37:56 2006 From: linas at austin.ibm.com (Linas Vepstas) Date: Mon, 31 Jul 2006 13:37:56 -0500 Subject: problem with example of mpn_gcd In-Reply-To: References: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> Message-ID: <20060731183756.GD4453@austin.ibm.com> On Sat, Jul 29, 2006 at 12:33:36PM -0300, D?cio Luiz Gazzoni Filho wrote: > On Jul 29, 2006, at 1:50 AM, Jiang wf wrote: > >so, please, anyone can give me some advise about this problem, thanks! > > Well I can. Drop any pretenses of being a computer programmer and go > be a manager or CEO somewhere. You don't have what it takes to be a > programmer. > > And whether you follow my advice or not, do not post to this mailing > list anymore. Your email nearly made me sick to my stomach. > > D?cio If this is how you write email, is this also how you write code? If your subroutines get an input that they don't like, do they get sick to thier stack? Corrupt some data somewhere, over-writing it with COBOL, just to show disapproval? I don't think good programmers write code like this, and they certainly don't write emails like this. --linas From linas at austin.ibm.com Mon Jul 31 20:23:38 2006 From: linas at austin.ibm.com (Linas Vepstas) Date: Mon, 31 Jul 2006 13:23:38 -0500 Subject: problem with example of mpn_gcd In-Reply-To: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> References: <82e8282d0607282150h68eebbf6xde3fb3ac9e218250@mail.gmail.com> Message-ID: <20060731182338.GC4453@austin.ibm.com> On Sat, Jul 29, 2006 at 06:50:04AM +0200, Jiang wf wrote: > hello, everyone, > > agcd.c: In function 'main': > agcd.c:9: warning: incompatible implicit declaration of built-in function > 'exit' #include #include --linas