Message294778
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. |
|
Date |
User |
Action |
Args |
2017-05-30 19:50:04 | mark.dickinson | set | recipients:
+ mark.dickinson, sam-s |
2017-05-30 19:50:04 | mark.dickinson | set | messageid: <1496173804.91.0.910592595339.issue30515@psf.upfronthosting.co.za> |
2017-05-30 19:50:04 | mark.dickinson | link | issue30515 messages |
2017-05-30 19:50:04 | mark.dickinson | create | |
|