Boost logo

Boost :

From: Maarten Kronenburg (M.Kronenburg_at_[hidden])
Date: 2006-05-29 16:49:29

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_at_[hidden]> wrote in message
> > 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:

Boost list run by bdawes at, gregod at, cpdaniel at, john at