Boost logo

Boost Users :

Subject: Re: [Boost-users] problems with C++ integer types
From: Daryle Walker (darylew_at_[hidden])
Date: 2012-01-31 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 built-in 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 built-in integers model a subset of real numbers, and the modulo properties (if present on the hardware) are a side-effect of the wrap-around mechanic. This isn't the case with an intentional modulo type (with arbitrary modulus). For instance, if we have a modulo-5 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.
                                               



Boost-users 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