This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author anthony-flury
Recipients anthony-flury
Date 2021-04-05.21:49:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
The behavior of a%b when a is positive and b is negative can be suprising. 

I understand that the behavior is so that the identity 

a = (a//b)*b + a%b 

can be preserved regardless of the signs of a or b.

but the result is different from other languages which is why it can be surprising.

I would be happy to do the grunt work to make the changes if some can suggest where.

Do we - add a warning to the https://docs.python.org/3/tutorial/introduction.html#numbers page, or should we link to a new page that details and explains the behavior. Which is more 'pythonic' in terms of documentation ?
History
Date User Action Args
2021-04-05 21:49:56anthony-flurysetrecipients: + anthony-flury
2021-04-05 21:49:56anthony-flurysetmessageid: <[email protected]>
2021-04-05 21:49:56anthony-flurylinkissue43737 messages
2021-04-05 21:49:56anthony-flurycreate