Message135176
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. |
|
Date |
User |
Action |
Args |
2011-05-05 08:35:19 | Kotan | set | recipients:
+ Kotan |
2011-05-05 08:35:19 | Kotan | set | messageid: <1304584519.64.0.99823949629.issue12005@psf.upfronthosting.co.za> |
2011-05-05 08:35:18 | Kotan | link | issue12005 messages |
2011-05-05 08:35:18 | Kotan | create | |
|