Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-06-03 12:59:10


"Maarten Kronenburg" <M.Kronenburg_at_[hidden]> writes:

> The base type unsigned int is a fact.

Yes, one that's borne out of a need not to lose any bits when
expressing numbers that can't be negative, which doesn't apply to
infinite precision integers.

> The modular_integer is a mathematical fact,

Yes, one that's totally incompatible with the idea of infinite
precision.

> and the base type unsigned int is modular.

Point being?

> And users that want an integer that
> is of infinite precision but they want to know
> for sure will never become negative,
> they have the option of using unsigned_integer.
> I don't see any evil in this.

Do you not acknowledge the costs of unnecessary complexity?

> And the other side of the story is that if we
> don't provide an unsigned_integer, people
> will start making it themselves

I doubt it. Have you met anyone who would go to the trouble to do so?
Does an unsigned infinite precision integer type exist anywhere today?

> , and then many unsigned integers will be floating around in the
> end, all a little bit different.

The separate range limiting wrapper is a separate library.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk