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 dechamps, steven.daprano, veky
Date 2021-07-10.06:36:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625899018.01.0.13265273423.issue44595@roundup.psfhosted.org>
In-reply-to
Content
Not a bug, the result is correct.

Python floats are binary floating point values, not decimal. 0.3368655's actual value is exactly:

0.336865499999999984392928809029399417340755462646484375

so when rounding to six decimal places, the seventh decimal place is a four, not five, and it rounds down to 0.336865. To be precise, it rounds down to:

0.336865000000000025526247782181599177420139312744140625
History
Date User Action Args
2021-07-10 06:36:58steven.dapranosetrecipients: + steven.daprano, veky, dechamps
2021-07-10 06:36:58steven.dapranosetmessageid: <1625899018.01.0.13265273423.issue44595@roundup.psfhosted.org>
2021-07-10 06:36:57steven.dapranolinkissue44595 messages
2021-07-10 06:36:57steven.dapranocreate