From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,6b26adc021beff24 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!v4g2000vba.googlegroups.com!not-for-mail From: "vincent.diemunsch@gmail.com" Newsgroups: comp.lang.ada Subject: Re: Ada binding to GMP and MPFR Date: Thu, 28 May 2009 05:47:09 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <72dd0e4d-1378-4cca-a72f-637f83f21686@e20g2000vbc.googlegroups.com> <4deb49a5-6d19-49dd-a7a8-ceed7adcb661@r3g2000vbp.googlegroups.com> <9fb53bdb-eb6a-4f59-8e8f-988071c07b5e@u9g2000pre.googlegroups.com> <0d5120bf-7581-4d4b-bdb4-e9d758e3a963@z5g2000yqn.googlegroups.com> NNTP-Posting-Host: 192.54.193.51 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1243514830 22685 127.0.0.1 (28 May 2009 12:47:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 28 May 2009 12:47:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v4g2000vba.googlegroups.com; posting-host=192.54.193.51; posting-account=hya6vwoAAADTA0O27Aq3u6Su3lQKpSMz User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6069 Date: 2009-05-28T05:47:09-07:00 List-Id: On 27 mai, 19:47, "John B. Matthews" wrote: > In article > <0d5120bf-7581-4d4b-bdb4-e9d758e3a...@z5g2000yqn.googlegroups.com>, > > =A0"vincent.diemun...@gmail.com" wrote: > > [...] > > > Thanks for your response. I have tried to host in GOOGLE Source : > >http://code.google.com/p/adabindinggmpmpfr/ > > I will now continue to test it. I would be very interested to recieve > > comments on it : > > - on the specification, if it is easy to use and clear, > > - on the implementation, > > etc. > > Um, the source tree appears to be empty at present; the same is true for > svn checkout: > > > > Somewhat tangentially, on Mac OS X, GNAT from MacAda looks formpfrand > gmp in /usr/local/lib. Users may wish to know that the libraries may be > conveniently built from source using MacPorts: > > : > > > > > See also, > > > > -- > John B. Matthews > trashgod at gmail dot com > Hello John, I have now added the files in the svn source tree ! I will add a little comment for Mac OS X users. I still have a little trouble in my sample program for the "translation" of the C sample program, with the function mpfr_out_str BUT I find the example of the Thick Ada Binding quite convincing : -- 1) Thick binding version : -- Note that we use Integers because they are EXACT values, to initialize -- Multiple precision floats or in computations with the latters -- and not float values, that are approximations of real values with a too -- small precision. declare use MPFR.Floats; Fact, Sum : MPFR_Float; begin Set_Default_Precision (Decimal_Digits =3D> 62); Fact :=3D To_MPFR_Float(1); Sum :=3D To_MPFR_Float(1); for i in 1 .. 100 loop Fact :=3D i * Fact; Sum :=3D Sum + 1 / Fact; end loop; Put_Line ("Sum is " & Image(Sum)); end; Regards.