Re: [boost] Infinite precision integer draft

----Original Message---- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Ben Artin Sent: 28 May 2006 19:23 To: boost@lists.boost.org Subject: Re: [boost] Infinite precision integer draft
In article <4479A423.8010904@getdesigned.at>, Sebastian Redl <sebastian.redl@getdesigned.at> wrote:
David Abrahams wrote:
Sebastian Redl <sebastian.redl@getdesigned.at> writes:
The main (only, really, when it comes down to it) difference between a signed and an unsigned integer is that an unsigned integer is defined never to have a value less than 0. There are very valid reasons to enforce such a restriction,
For example?
Various physical quantities only make sense for non-negative values.
Wait a minute... please name one physical quantity that is
a) Always integer b) Never negative c) Not just an enum (i.e., not just a finite set of possible values)
I can't think of one, which makes me think that your argument about physical values is irrelevant, as you'd never use an unsigned *integer* for a physical value.
Stretching "physical" slightly, but how about "the number of elements of a given set"? (Where such a set could be "the number of people alive today"). The only difficulty I see with that, is that a 64-bit "long long" would be more than enough for my example. That raises the question, what are the use cases for the integer class? -- Martin Bonner Martin.Bonner@Pitechnology.com Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 203894
participants (1)
-
Martin Bonner