Mark Dickinson <dicki...@gmail.com> added the comment: Section 5.11 of IEEE 754-2008, paragraph 2, says:
"""Infinite operands of the same sign shall compare equal.""" So Python's behaviour follows the standard here. Producing 'is close to' tests is always tricky if you want to be able to deal with IEEE special values (subnormals, negative zero, infinities, NaNs). You could always write your unittest as: if not (value1 == value2 or <relative_error_test>). but this still doesn't consider NaNs, and probably doesn't do what you want for subnormals either. Closing as invalid. ---------- nosy: +marketdickinson resolution: -> invalid status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6675> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com