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 steven.daprano
Recipients ahmad dana, eric.smith, remi.lapeyre, steven.daprano
Date 2020-04-06.15:51:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586188276.87.0.357381176875.issue40206@roundup.psfhosted.org>
In-reply-to
Content
Rémi, it is not true that the Decimal module won't lose precision. It will. Decimal is not exact either, it is still a floating point format similar to float.

py> Decimal(1)/3*3
Decimal('0.9999999999999999999999999999')

The two major advantages of Decimal are: it matches the number you type more closely, and you can choose how much precision to use. (At the cost of memory and speed.) But there are also disadvantages: rounding errors with Decimal tend to be larger on average than for binary floats.

If you want exact calculations that will never lose precision, you have to use Fractions, but that is slower and less convenient.
History
Date User Action Args
2020-04-06 15:51:16steven.dapranosetrecipients: + steven.daprano, eric.smith, remi.lapeyre, ahmad dana
2020-04-06 15:51:16steven.dapranosetmessageid: <1586188276.87.0.357381176875.issue40206@roundup.psfhosted.org>
2020-04-06 15:51:16steven.dapranolinkissue40206 messages
2020-04-06 15:51:16steven.dapranocreate