Boost logo

Boost :

Subject: Re: [boost] Arbitrary precision arithmetic
From: Barend Gehrels (barend_at_[hidden])
Date: 2009-08-19 05:40:54


Paul A. Bristow wrote:
>> The boost community is not set up to duplicate what GMP does. But I
>> think we could do something else very well if we focus on correctness,
>> portability, and metaprogramming API tastiness instead of making the
>> tires smoke.
> Or better, as recently proposed, also allow one to use GMP if desired.
> That should get the tires warm, if not smoking.
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,

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

> Although the people who want speed, want it badly, most people don't really
> care.
> What most people also care about, is control of the behaviour at the limits
> (NaN/inf/divzero/overflow).
> So a policy based implementation is essential. But I suspect that, with
> some forethought, that can be added later.
> We seem to have several nearly finished offerings, but none reviewed for the
> Official Boost Logo.
It is not finished ('nearly finished' indeed) but you might have a look.

Regards, Barend


Boost list run by bdawes at, gregod at, cpdaniel at, john at