Q: Feature Wish: "%" Extension

John Roth johnroth at ameritech.net
Sun Nov 4 15:08:49 EST 2001


"Tim Peters" <tim.one at home.com> wrote in message
news:mailman.1004858117.20012.python-list at python.org...

>
> An odd thing is that, when this comes up, people complain that under
> Python's current rules it's not necessarily the case that
>
>     (-i)/j == -(i/j)
>
> Across decades of integer numeric programming, I can't recall any
*use* for
> that identity; but that i%j >= 0 whenever j>0 is endlessly useful, as
is
> your identity relating int-div and int-mod.

Useful as it is, it makes division not be the
inverse of multiplication, so it's mathematically incorrect,
and hence astonishing to people who don't know the score.

John Roth

>
> doing-a-right-thing-is-a-trial-ly y'rs  - tim
>
>





More information about the Python-list mailing list