Patricia Shanahan wrote: > abo wrote: > > Patricia Shanahan wrote: > >> I am very familiar with the difficulties of arithmetic with a bounded > >> range. You lose all sorts of useful properties, such as associativity > >> and commutativity of addition. Adding up numbers in one order may lead > >> to an overflow, adding them in a different order doesn't. > > > > Order doesn't matter if one is working in the natural numbers, of > > course. In the natural numbers both commutativity and associativity > > hold, in these forms: > > > > (x)(y)(z)(x + y = z ==> y + x = z) > > (u)(x)(y)(z)(u + (x + y) = z ==> (u + x) + y = z) > > > > Yes, I was wrong in a couple of ways. Commutativity is not affected by > gaps and bounds, and bounds do not affect unsigned addition associativity. > > However, associativity is lost for signed arithmetic if there are > bounds, and even for unsigned arithmetic if there are gaps. > > For example, u, (x+y), and u+(x+y)=z could all exist, but u+x could fall > in a gap, and not exist.
Agreed. Just would like to emphasize your "could fail". There can be gappy systems where associativity holds.