![]() |
GMP For Delphi
If anyone is interested, I've got GMP (GNU Multiple Precision Arithmetic Library) for Delphi (I'm using 7 Enterprise, but it should'nt matter) available.
I searched for a while, to get this, and finally had to bite the bullet and perform the header conversions manually. The package is available as: [list][*]gmp.dll -- The DLL itself (4.0.1)[*]gmpDLL.pas -- The interface unit (mpz_XXX, mpq_XXX and mpf_XXX)[*]gmpClasses -- A very basic and incomplete attempt at an OOPS library on top of GMP[/list] If anyone is interested, PM me... -- Alan |
[QUOTE=amcfarlane]If anyone is interested, I've got GMP (GNU Multiple Precision Arithmetic Library) for Delphi (I'm using 7 Enterprise, but it should'nt matter) available.
I searched for a while, to get this, and finally had to bite the bullet and perform the header conversions manually. The package is available as: [list][*]gmp.dll -- The DLL itself (4.0.1)[*]gmpDLL.pas -- The interface unit (mpz_XXX, mpq_XXX and mpf_XXX)[*]gmpClasses -- A very basic and incomplete attempt at an OOPS library on top of GMP[/list] If anyone is interested, PM me... -- Alan[/QUOTE] I AM!!!! :bow: :banana: :bow: :banana: :bow: Provided it works on Delphi 5... :innocent: Luigi |
4.0.1 has bugs in the FFT code and subtraction code that can result in (rare) wrong computations.
|
[QUOTE=ColdFury]4.0.1 has bugs in the FFT code and subtraction code that can result in (rare) wrong computations.[/QUOTE]
:rant: ! Well, the pascal interface should work, with little or no modification, assuming we can get hold of a different DLL... I'll post it here later on. BTW, any know of some nice tests that I could run on it? |
It's not difficult at all to compile a new DLL using MingW. I've done it a number of times.
|
I'm glad someone gets MinGW to recompile GMP... Mine always goes belly up - big time.
Darn, I'm having big problems uploading this... If anyone wants the code, please PM me there email address and I'll forward it on. |
Can you get the static library to compile?
|
amcfarlane, i am interested in the gmp files for delphi, please check your pm inbox :smile:
|
Sorry for the delay folks - I've had some weird problems uploading attachments to this forum or even in simple emails... I'm preparing a simple one page site for all the relevant software which I'll try and get up and running once I've checking this darn puter!
Apologies to anyone who requested copies, but just keep your eyes peeled! |
Finally, the software is available (at least in a limited form...) Get it from [URL]http://rbe.netfirms.com/[/URL].
Any problems, questions, etc, PM me... |
[QUOTE=amcfarlane]Finally, the software is available (at least in a limited form...) Get it from [URL]http://rbe.netfirms.com/[/URL].
Any problems, questions, etc, PM me...[/QUOTE] Thank you! Disregard my last request on PM :rolleyes: It seems that your host don't allow you to set up files bigger than 256 KB, so the PDF can't be downloaded. Luigi |
Ah - That's what it is - I was wondering why I couldn't up/down load the pdfs... :)
Hopefully it's of some use - just remember it's not going to be as fast as a native C version due to the overhead of preping each call, but it works for me :) |
I've just uploaded those files to my webspace:
[url]http://www.mystwalker.de/gmpdelphi[/url] If you send me the documentation, I can put it up as well. |
I am new in Delphi and I do not understand why the folowing console prog (using GMP) work :
program EssaiGmp1; {$APPTYPE CONSOLE} uses ShareMem, SysUtils, GMP; var p : mpz_t; s : AnsiString; a, e : cardinal; begin Writeln('Valeur de a :'); readln(a); Writeln('Valeur de e : '); Readln(e); mpz_init(p); mpz_ui_pow_ui(p,a,e); s:=mpz_get_str(nil,10,p); writeln('resultat : ',s); mpz_clear(p); readln end. but the Windows corresponding prog do not work : unit EssaiGmpWin1; interface uses ShareMem, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Eda: TEdit; Ede: TEdit; ButCalc: TButton; LabResult: TLabel; ButFin: TButton; procedure ButFinClick(Sender: TObject); procedure ButCalcClick(Sender: TObject); private { Déclarations privées } public { Déclarations publiques } end; var Form1: TForm1; implementation {$R *.dfm} uses GMP; procedure TForm1.ButFinClick(Sender: TObject); begin application.Terminate; end; procedure TForm1.ButCalcClick(Sender: TObject); var a,e : Cardinal; s : AnsiString; p : mpz_t; begin a:=StrToInt(Eda.Text); e:=StrToInt(Ede.Text); mpz_init(p); mpz_ui_pow_ui(p,a,e); s:=mpz_get_str(nil,10,p); LabResult.Caption:=s; mpz_clear(p); end; end. I am French and my English is poor. Thanks for any help. Pi |
| All times are UTC. The time now is 22:32. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.