|
Boost : |
Subject: Re: [boost] Arbitrary precision arithmetic
From: John Maddock (john_at_[hidden])
Date: 2009-08-19 12:11:35
> You might refer to our mails this spring. We (Bruno and I) are
> implementing a 'numeric adaptor' library, to be optionally used in our
> generic geometry library, but developed completely separately.
>
> It is currently in the Boost Sandbox,
> https://svn.boost.org/svn/boost/sandbox/numeric_adaptor/
>
> It provides interfaces to GMP and CLN (another big number library),
> which can be used the same way as normal (IEEE) integers / doubles can
> be used. We recently changed and simplified the design. It now works
> more or less as Joel mailed today. It is template based, no virtual
> functions here. So Joel's sample would become:
>
> double x;
> boost::numeric_adaptor::gmp_value_type y;
> x = abs(x); <-- call the IEEE implementation
> y = abs(y); <-- call the GMP implementation
>
Also don't forget that Boost.Math has simple bindings for NTL and MPFR (the
latter using GMP internally) that allow these to be used as any other
floating point type would be (including std lib transcendental functions
etc).
Cheers, John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk