[issue12005] modulo result of Decimal differs from float/int

2011-05-05 Thread Daniel Albeseder
New submission from Daniel Albeseder : I know that the modulo operation for negative values is not well defined, but I would at least expect that the result is the same no matter if you use ints, floats or decimals. However Decimal seem to behave else than the builtin types. Python 3.1.2 (rele

[issue12005] modulo result of Decimal differs from float/int

2011-05-05 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue12005] modulo result of Decimal differs from float/int

2011-05-05 Thread Mark Dickinson
Mark Dickinson added the comment: I believe that this was a deliberate design decision, though now that I look it seems it's not well documented. That should probably be fixed, so I see this as a documentation issue. More details: The specification on which the decimal module is based requi

[issue12005] modulo result of Decimal differs from float/int

2011-05-05 Thread Mark Dickinson
Mark Dickinson added the comment: The doc change should also note that // and divmod suffer from a similar mismatch: >>> Decimal(-2) // Decimal(3) Decimal('-0') >>> -2 // 3 -1 >>> -2.0 // 3 -1.0 However, the invariant that x = x // y * y + x % y is retained, as it should be. --

[issue12005] modulo result of Decimal differs from float/int

2011-05-05 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list ma

[issue12005] modulo result of Decimal differs from float/int

2012-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 290f3b75480f by Mark Dickinson in branch '2.7': Issue #12005: clarify behaviour of % and // for Decimal objects. http://hg.python.org/cpython/rev/290f3b75480f -- nosy: +python-dev ___ Python tracker

[issue12005] modulo result of Decimal differs from float/int

2012-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0ec314f26791 by Mark Dickinson in branch '3.2': Issue #12005: clarify behaviour of % and // for Decimal objects. http://hg.python.org/cpython/rev/0ec314f26791 New changeset f626c214cad0 by Mark Dickinson in branch '3.3': Issue #12005: merge doc patc

[issue12005] modulo result of Decimal differs from float/int

2012-11-18 Thread Mark Dickinson
Mark Dickinson added the comment: Docs updated. -- assignee: rhettinger -> mark.dickinson resolution: -> fixed status: open -> closed versions: +Python 3.4 ___ Python tracker __

[issue12005] modulo result of Decimal differs from float/int

2012-11-18 Thread Stefan Krah
Stefan Krah added the comment: Mark, there's a small typo in the patch: "preseve the usual identity" -- nosy: +skrah ___ Python tracker ___ __

[issue12005] modulo result of Decimal differs from float/int

2012-11-18 Thread Mark Dickinson
Mark Dickinson added the comment: D'oh! Thanks. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue12005] modulo result of Decimal differs from float/int

2012-11-18 Thread Mark Dickinson
Mark Dickinson added the comment: Typo now fixed. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue12005] modulo result of Decimal differs from float/int

2011-12-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +easy stage: -> needs patch versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6, Python 3.1 ___ Python tracker ___ _

[issue12005] modulo result of Decimal differs from float/int

2012-01-07 Thread Aaron Maenpaa
Aaron Maenpaa added the comment: Here is a patch that adds an explination for the difference in the behaviour to the FAQ section of the Decimal documentation. -- keywords: +patch nosy: +zacherates Added file: http://bugs.python.org/file24162/issue12005.diff ___