Message248249
I don't agree with "not a bug".
>>> s1, v1, ndigits1 = "1.65", 1.65, 1
>>> s2, v2, ndigits2 = "2.675", 2.675, 2
>>> decimal.Decimal(v1)
Decimal('1.649999999999999911182158029987476766109466552734375')
>>> round(v1, ndigits1)
1.6
>>> round(decimal.Decimal(s1), ndigits1)
Decimal('1.6') # EQUAL expression round(v1, ndigits1)
>>> decimal.Decimal(v2)
Decimal('2.67499999999999982236431605997495353221893310546875')
>>> round(v2, ndigits2)
2.67
>>> round(decimal.Decimal(s2), ndigits2)
Decimal('2.68') # DIFFERENT expression round(v2, ndigits2)
decimal module should give me different expression about below.
round(decimal.Decimal(s1), ndigits1) and round(v1, ndigits1).
BECAUSE
round(decimal.Decimal(s2), ndigits2) and round(v2, ndigits2)
give me DIFFERENT expression. |
|
Date |
User |
Action |
Args |
2015-08-08 05:38:41 | umedoblock | set | recipients:
+ umedoblock, zach.ware |
2015-08-08 05:38:41 | umedoblock | set | messageid: <1439012321.54.0.470801950622.issue24827@psf.upfronthosting.co.za> |
2015-08-08 05:38:41 | umedoblock | link | issue24827 messages |
2015-08-08 05:38:40 | umedoblock | create | |
|