Jussi Piitulainen <jpiit...@ling.helsinki.fi> wrote: > Terry Reedy writes: > > On 12/12/2011 5:59 AM, Jussi Piitulainen wrote: > > > > > Past experience in mathematics newsgroups tells me > > > that some mathematicians do not accept the existence of any remainder > > > operator at all. > > > > Even though they carry hour/minute/second remindering devices on their > > bodies and put year/month/day remaindering devices on their wall? > > 'Twould be strange indeed! > > They recognize modular arithmetic but for some reason insist that > there is no such _binary operation_. But as I said, I don't understand > their concern. (Except the related concern about some programming > languages, not Python, where the remainder does not behave well with > respect to division.)
They are probably arguing that it's uniquely defined only on ZxN and that there are different conventions to extend it to ZxZ (the programming languages problem that you allude to above - although I don't know what you mean by "does not behave well wrt division"). See http://en.wikipedia.org/wiki/Remainder If you choose one convention and stick to it, it becomes a well-defined binary operation. C99 goes one way, python goes a different way (and mathematics textbooks generally go a third way) and they are all happy, as long as they don't try to talk to each other (e.g., porting C99 programs to python unthinkingly leads to trouble - duh). It was implementation dependent in old C (whatever the hardware would give you), which predictably - with 20-20 hindsight - turned out to be a Very Bad Idea. Nick PS Z = integers, N = non-negative integers -- http://mail.python.org/mailman/listinfo/python-list