|Distributivity and types email@example.com (Sanjay Pujare) (1999-05-22)|
|Re: Distributivity and types firstname.lastname@example.org (1999-05-22)|
|Re: Distributivity and types email@example.com (1999-05-27)|
|Re: Distributivity and types firstname.lastname@example.org (1999-05-27)|
|Re: Distributivity and types email@example.com (1999-05-29)|
|Re: Distributivity and types firstname.lastname@example.org (1999-05-29)|
|Date:||29 May 1999 01:09:11 -0400|
|Organization:||Deja.com - Share what you know. Learn what you don't.|
|References:||99-05-111 99-05-122 99-05-140|
email@example.com (Anton Ertl) wrote:
> Only if overflows trap. If, OTOH, you use modulo (aka wrap-around)
> arithmetic, this law holds (as do many others, because the cardinal
> numbers modulo 2^N are a field; two's complement numbers are just a
> different interpretation, the operations + and * are the same as for
> unsigned numbers) and you will get the correct answer.
A minor (if slightly off-topic) point: The integers modulo 2^N are
definitely not a field unless N=1. In general, the integers mod d
form a field if and only if d is prime. However, the integers mod d
always form a ring under + and *. I assume this is what you meant.
[An example reveals that the integers mod 4 do not form a field
under + and *.
2 * 0 = 0 (mod 4)
2 * 1 = 2 (mod 4)
2 * 2 = 0 (mod 4)
2 * 3 = 2 (mod 4)
Therefore there is no multiplicative inverse of 2.]
Return to the
Search the comp.compilers archives again.