Message299136
I think Terry and his OP are reacting to the fact that "-190 % 12 == -10" looks like it is saying that that expression is True in Python, which it is not (and that's the point).
IMO, another issue is that "and then compilers that truncate i // j need to make i % j have the same sign as i." doesn't have enough connection in the naive reader's mind with "-190 % 12 == -10 is a bug waiting to bite" for easy comprehension.
A potential fix to both these issues would be to say "if -190 % 12 were equal to -10 in Python (the way it is in most C programs), that would quite often be a bug waiting to happen in code using the % operator." |
|
Date |
User |
Action |
Args |
2017-07-25 19:46:43 | r.david.murray | set | recipients:
+ r.david.murray, terry.reedy, mark.dickinson, docs@python, wohlganger |
2017-07-25 19:46:43 | r.david.murray | set | messageid: <1501012003.06.0.948030349421.issue31021@psf.upfronthosting.co.za> |
2017-07-25 19:46:43 | r.david.murray | link | issue31021 messages |
2017-07-25 19:46:43 | r.david.murray | create | |
|