Petter S <petter.strandm...@gmail.com> added the comment:
I am of the opposite opinion. :-) > if I know roughly what the float should be why would I not want to test it > for exactness? When testing algorithms, it is often the case that the answer should be mathematically exactly 2, but due to floating-point inexactness it becomes, say, 1.9999999997 in practice. If I then test for exactly 1.9999999997 the test becomes very brittle and sensitive for e.g. order of multiplications. Testing floating point numbers with a relative error is essential in many application. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35656> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com