
Gerhard, Unfortunately I know nothing about threading. The integer class itself also has static variables, although not static integers. Will this then also be a threading problem? Users are of course free to make an unsigned integer with a non-static modulus. The sign of x mod y is the sign of y (or zero). This means that when the user supplies a negative modulus, the unsigned integers are always negative or zero. This seems to me to be the most consistent. Regards, Maarten. "Gerhard Wesp" <gwesp@google.com> wrote in message news:20060529143644.GE29026@google.com...
So the unsigned_integer would have a static method void set_modulus( const integer & ).
I'd prefer not to have a program-global modulus. Remember that we're also trying to put threading into TR2.
Alternatives: - Optional modulus argument to certain functions. This seems to be the approach that Mathematica chooses. - Maybe a reference to the modulus in the constructor.
[ Yes, I know that NTL uses the static modulus approach. Still, my gut feeling tells me this is suboptimal. ]
BTW, it seems strange that modular arithmetic should restricted to unsigned integers.
Regards -Gerhard -- Gerhard Wesp ZRH office voice: +41 (0)44 668 1878 ZRH office fax: +41 (0)44 200 1818 For the rest I claim that raw pointers must be abolished. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost