
Boost Users : 
Subject: Re: [Boostusers] problems with C++ integer types
From: Dave Abrahams (dave_at_[hidden])
Date: 20120201 17:40:34
on Tue Jan 31 2012, Daryle Walker <darylewAThotmail.com> wrote:
>> From: John
>> Date: Tue, 31 Jan 2012 16:28:41 +0000
>>
>> > Modulo: NO
>>
>> Integer types that are bounded (fixed precision) and implement
> modular
>> arithmetic (ie builtin integers on most/all platforms) can and
> should set
>> is_modulo field to true.
>
> Yes, but that's not what I'm talking about. The builtin integers
> model a subset of real numbers, and the modulo properties (if present
> on the hardware) are a sideeffect of the wraparound mechanic. This
> isn't the case with an intentional modulo type (with arbitrary
> modulus). For instance, if we have a modulo5 UDT, then the value
> "1" represents not just 1, but any integer that can be expressed as
> 5x + 1. Since the state represents a whole class of numbers, it
> doesn't model to real numbers any more than a polynomial type does.
I think that's a valid, but pretty twisted, way to look at it. An
instance of a modulo5 UDT only represents a whole class of numbers if
that's dictated by the way it's being used. It's no more intrinsically
a representative of a class than it is an individual.
 Dave Abrahams BoostPro Computing http://www.boostpro.com
Boostusers list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net