
Boost Users : 
Subject: Re: [Boostusers] problems with C++ integer types
From: Daryle Walker (darylew_at_[hidden])
Date: 20120131 12:40:17
> 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.
Daryle W.
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