Message22501
The Decimal class behaves differently from the builtin
integer and float classes when performing modulus and
integer division operations:
>>> decimal.Decimal("14") % decimal.Decimal("10)
Decimal("4")
>>> decimal.Decimal("-14") % decimal.Decimal("10")
Decimal("-4)
>>> 14 % 10
4
>>> -14 % 10
6
Similar behavior occurs with negative numbers with the
integer division operator //.
Should these behave the same way? |
|
Date |
User |
Action |
Args |
2007-08-23 14:26:22 | admin | link | issue1031480 messages |
2007-08-23 14:26:22 | admin | create | |
|