Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/faq/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ the same sign as ``i``.
There are few real use cases for ``i % j`` when ``j`` is negative. When ``j``
is positive, there are many, and in virtually all of them it's more useful for
``i % j`` to be ``>= 0``. If the clock says 10 now, what did it say 200 hours
ago? ``-190 % 12 == 2`` is useful; ``-190 % 12 == -10`` is a bug waiting to
ago? ``-190 % 12 == 2`` is useful; ``-190 % -12 == -10`` is a bug waiting to
bite.

@terryjreedy terryjreedy Jul 24, 2017 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trivial correction is wrong, and it misses the point of the 'False' equality. If -190 % 12 were -10 instead of 2, it would be less useful and possibly lead to bugs.



Expand Down