Boost logo

Boost :

Subject: Re: [boost] [mp_int] new release
From: Scott McMurray ([hidden])
Date: 2008-10-08 13:31:56

On Wed, Oct 8, 2008 at 12:30, Paul A Bristow <pbristow_at_[hidden]> wrote:
> So are you proposing two names:
> bounded_int - arbitrary but fixed (maximum?) size integer
> unbounded_int - grows to accommodate a size (bounded only by machine memory).

I'm just proposing the latter name, as the documentation specifies
that the integers "grow dynamically as needed".

I would be interested in a general facility for arbitrary-sized
integers (so I could add 2 64-bit numbers on any architecture as
bounded_int<65>s, for example, with no possibility of overflow), but
that's out of scope for this proposal. (It would be nice if it could
be done just with a different allocator, but I don't think that's
feasible, currently.)

> As an aside, does this scale to floating-point?
> If we were to produce a Boost equivalent to NTL quad_float bounded_float and RR - arbitrary but fixed (default 50 decimal digits)
> and an unbounded Exact real,
> for example to
> unbounded_float (or unbounded_real)
> similar to exact real - but then exact_real would be more obvious?

I dislike exact_real, since there are obviously an infinite number of
reals that cannot be held exactly.

> and bounded_float or bounded_real
> But then one wants to encode the real precision? float, double, quad_float, octo_float...

I presume the bits of mantissa and exponent would be template parameters.

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