Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal.remainder_near documentation incorrect. #60552

Closed
mdickinson opened this issue Oct 28, 2012 · 5 comments
Closed

Decimal.remainder_near documentation incorrect. #60552

mdickinson opened this issue Oct 28, 2012 · 5 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@mdickinson
Copy link
Member

BPO 16348
Nosy @mdickinson, @asvetlov
Files
  • issue16348.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/mdickinson'
    closed_at = <Date 2012-10-31.19:47:34.076>
    created_at = <Date 2012-10-28.12:20:53.193>
    labels = ['docs']
    title = 'Decimal.remainder_near documentation incorrect.'
    updated_at = <Date 2012-10-31.19:47:34.074>
    user = 'https://github.com/mdickinson'

    bugs.python.org fields:

    activity = <Date 2012-10-31.19:47:34.074>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2012-10-31.19:47:34.076>
    closer = 'mark.dickinson'
    components = ['Documentation']
    creation = <Date 2012-10-28.12:20:53.193>
    creator = 'mark.dickinson'
    dependencies = []
    files = ['27766']
    hgrepos = []
    issue_num = 16348
    keywords = ['patch']
    message_count = 5.0
    messages = ['174039', '174043', '174128', '174357', '174358']
    nosy_count = 4.0
    nosy_names = ['mark.dickinson', 'asvetlov', 'docs@python', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'needs patch'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue16348'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3', 'Python 3.4']

    @mdickinson
    Copy link
    Member Author

    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')

    @mdickinson mdickinson added the docs Documentation in the Doc dir label Oct 28, 2012
    @mdickinson
    Copy link
    Member Author

    Here's a doc patch.

    @asvetlov
    Copy link
    Contributor

    LGTM

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 31, 2012

    New changeset 1122f5bfc957 by Mark Dickinson in branch '2.7':
    Issue bpo-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 bpo-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 bpo-16348: merge fix from 3.2.
    http://hg.python.org/cpython/rev/9dc587378874

    New changeset 7b36ed59738c by Mark Dickinson in branch 'default':
    Issue bpo-16348: merge fix from 3.3.
    http://hg.python.org/cpython/rev/7b36ed59738c

    @mdickinson
    Copy link
    Member Author

    Thanks for reviewing, Andrew.

    @mdickinson mdickinson assigned mdickinson and unassigned docspython Oct 31, 2012
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants