New submission from Daniel Albeseder <ko...@gmx.at>: 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 (release31-maint, Sep 17 2010, 20:27:33) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> -3 % 5 2 >>> -3. % 5. 2.0 >>> Decimal(-3) % Decimal (5) Decimal('-3') >>> I could reproduce the same for python 2.6.6. ---------- components: Library (Lib) messages: 135176 nosy: Kotan priority: normal severity: normal status: open title: modulo result of Decimal differs from float/int type: behavior versions: Python 2.6, Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12005> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com