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.

classification
Title: Decimal.remainder_near documentation incorrect.
Type: Stage: needs patch
Components: Documentation Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: asvetlov, docs@python, mark.dickinson, python-dev
Priority: normal Keywords: patch

Created on 2012-10-28 12:20 by mark.dickinson, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue16348.patch mark.dickinson, 2012-10-28 12:49 review
Messages (5)
msg174039 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2012-10-28 12:20
The documentation for Decimal.remainder_near is incorrect.  It states:

"If both are equally close, the one chosen will have the same sign as self."

That's incorrect:  instead, the chosen remainder has the property that it makes the corresponding quotient even rather than odd.  E.g.,

>>> Decimal(25).remainder_near(Decimal(10))
Decimal('5')
>>> Decimal(35).remainder_near(Decimal(10))
Decimal('-5')
msg174043 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2012-10-28 12:49
Here's a doc patch.
msg174128 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-29 16:41
LGTM
msg174357 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-31 19:45
New changeset 1122f5bfc957 by Mark Dickinson in branch '2.7':
Issue #16348: Fix incorrect documentation for Decimal.remainder_near.
http://hg.python.org/cpython/rev/1122f5bfc957

New changeset 8570943ad5a2 by Mark Dickinson in branch '3.2':
Issue #16348: Fix incorrect documentation for Decimal.remainder_near.
http://hg.python.org/cpython/rev/8570943ad5a2

New changeset 9dc587378874 by Mark Dickinson in branch '3.3':
Issue #16348: merge fix from 3.2.
http://hg.python.org/cpython/rev/9dc587378874

New changeset 7b36ed59738c by Mark Dickinson in branch 'default':
Issue #16348: merge fix from 3.3.
http://hg.python.org/cpython/rev/7b36ed59738c
msg174358 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2012-10-31 19:47
Thanks for reviewing, Andrew.
History
Date User Action Args
2022-04-11 14:57:37adminsetgithub: 60552
2012-10-31 19:47:34mark.dickinsonsetstatus: open -> closed
assignee: docs@python -> mark.dickinson
resolution: fixed
messages: + msg174358
2012-10-31 19:45:37python-devsetnosy: + python-dev
messages: + msg174357
2012-10-29 16:41:07asvetlovsetnosy: + asvetlov
messages: + msg174128
2012-10-28 12:49:07mark.dickinsonsetfiles: + issue16348.patch
keywords: + patch
messages: + msg174043
2012-10-28 12:20:53mark.dickinsoncreate