From: "vincent.diemunsch@gmail.com" <vincent.diemunsch@gmail.com>
Subject: Re: Ada binding to GMP and MPFR
Date: Thu, 28 May 2009 05:47:09 -0700 (PDT)
Date: 2009-05-28T05:47:09-07:00 [thread overview]
Message-ID: <b7a9794d-9973-4d85-9e09-c3c0e14b5c4d@v4g2000vba.googlegroups.com> (raw)
In-Reply-To: nospam-B9D87E.13474227052009@news.aioe.org
On 27 mai, 19:47, "John B. Matthews" <nos...@nospam.invalid> wrote:
> In article
> <0d5120bf-7581-4d4b-bdb4-e9d758e3a...@z5g2000yqn.googlegroups.com>,
>
> "vincent.diemun...@gmail.com" <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:
>
> <http://code.google.com/p/adabindinggmpmpfr/source/browse/>
>
> 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:
>
> <http://www.macports.org/>:
> <http://trac.macports.org/browser/trunk/dports/devel/mpfr/Portfile>
> <http://trac.macports.org/browser/trunk/dports/devel/gmp/Portfile>
> <http://www.macada.org/>
>
> See also,
>
> <http://trac.macports.org/browser/trunk/dports/lang/gnat-gcc/Portfile>
>
> --
> John B. Matthews
> trashgod at gmail dot com
> <http://sites.google.com/site/drjohnbmatthews>
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 => 62);
Fact := To_MPFR_Float(1);
Sum := To_MPFR_Float(1);
for i in 1 .. 100 loop
Fact := i * Fact;
Sum := Sum + 1 / Fact;
end loop;
Put_Line ("Sum is " & Image(Sum));
end;
Regards.
next prev parent reply other threads:[~2009-05-28 12:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-20 14:19 Ada binding to GMP and MPFR vincent.diemunsch
2009-05-20 14:30 ` Ludovic Brenta
2009-05-20 15:24 ` qunying
2009-05-27 15:35 ` vincent.diemunsch
2009-05-27 17:47 ` John B. Matthews
2009-05-28 12:47 ` vincent.diemunsch [this message]
2009-05-28 19:41 ` John B. Matthews
2009-05-28 20:23 ` vincent.diemunsch
2009-05-29 0:30 ` John B. Matthews
2009-05-29 12:01 ` vincent.diemunsch
2009-05-29 17:08 ` qunying
2009-05-29 16:55 ` Pascal Obry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox