fixed size integer arithmetic

Martin d Anjou point14 at
Thu Aug 30 03:39:39 CEST 2007

> On 29 Aug 2007, at 12:23, Paul Leyland wrote:
>>> I think the original spec. was unambiguous on this point.   As I read
>>> it, he's asking for arithmetic in Z/Z_N where N is a fixed power
>>> of two.

No, N is not a power of 2. It is fixed though.

>> It should, of course, be "arithmetic in Z_N".  I don't know why a
>> spurious "Z/" crept in.  I do know that I need to improve my proof
>> reading.
> The modern construction is Z_n := Z/nZ, the ring of integers Z
> divided out with the ideal nZ = (n) = {kn| k in Z}. One can also
> construct Z_n as Z divided out with the equivalence relation mod n.

I understand the ring of integers.

> As for the original question, n = 2^k, where k is the number of bits.
> If one uses 2s complement representation for signed integral types,
> the only difference between signed and unsigned integral types is the
> lifting of the coset representatives of Z_n into Z. So they can be
> replaced by a single type with different (signed/unsigned) printing
> functions.

I don't understand the "coset representatives of Z_n into Z".


More information about the gmp-discuss mailing list