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 mark.dickinson
Recipients mark.dickinson, sam-s
Date 2017-05-30.19:50:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496173804.91.0.910592595339.issue30515@psf.upfronthosting.co.za>
In-reply-to
Content
The `assertAlmostEqual` comparison looks at the difference between the two values, and rounds that to 2 decimal places. In this case, the difference is approximately 0.00505, which rounded to 2 decimal places is 0.01.

If instead each of the two values were rounded and the rounded values compared, you'd end up in a situation where (for example) `self.assertEqual(1.144999999, 1.145000001, places=2)` failed, despite the values being only 2 billionths apart.
History
Date User Action Args
2017-05-30 19:50:04mark.dickinsonsetrecipients: + mark.dickinson, sam-s
2017-05-30 19:50:04mark.dickinsonsetmessageid: <1496173804.91.0.910592595339.issue30515@psf.upfronthosting.co.za>
2017-05-30 19:50:04mark.dickinsonlinkissue30515 messages
2017-05-30 19:50:04mark.dickinsoncreate