This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author umedoblock
Recipients umedoblock, zach.ware
Date 2015-08-08.07:11:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439017901.21.0.365029270297.issue24827@psf.upfronthosting.co.za>
In-reply-to
Content
last compared results are different.
should be bug or at least think that how to get a same result
about "D(round(df2, 2)) == D(round(ds2, 2))"

>>> from decimal import Decimal as D
>>> f1 = 1.65
>>> s1 = str(f1)
>>> df1 = D(f1)
>>> ds1 = D(s1)
>>> f2 = 2.675
>>> s2 = str(f2)
>>> df2 = D(f2)
>>> ds2 = D(s2)

>>> f1, df1, ds1
(1.65, Decimal('1.649999999999999911182158029987476766109466552734375'), Decimal('1.65'))
>>> f2, df2, ds2
(2.675, Decimal('2.67499999999999982236431605997495353221893310546875'), Decimal('2.675'))

>>> D(round(df1, 1)) == D(round(ds1, 1))
True
>>> D(round(df2, 2)) == D(round(ds2, 2))
False
History
Date User Action Args
2015-08-08 07:11:41umedoblocksetrecipients: + umedoblock, zach.ware
2015-08-08 07:11:41umedoblocksetmessageid: <1439017901.21.0.365029270297.issue24827@psf.upfronthosting.co.za>
2015-08-08 07:11:41umedoblocklinkissue24827 messages
2015-08-08 07:11:40umedoblockcreate