New submission from Jean-Michel Fauth <wxjmfa...@gmail.com>: I did not find any report about this.
Windows 7, Python 2.6.4 >>> float('inf') == float('inf') True >>> float('-inf') == float('-inf') True >>> float('-inf') == float('inf') False >>> float('-inf') != float('inf') True >>> float('nan') == float('nan') False >>> float('nan') != float('nan') True >>> I'm not an expert on that field, I wonder if the following is not related to a sign bit missmatch, see also Python 3.1.1 below. >>> copysign(1, float('inf')) 1.0 >>> copysign(1, float('-inf')) -1.0 >>> copysign(1, float('nan')) -1.0 >>> copysign(1, float('-nan')) -1.0 >>> Windows 7, Python 3.1.1 >>> float('inf') == float('inf') True >>> float('-inf') == float('-inf') True >>> float('-inf') == float('inf') False >>> float('-inf') != float('inf') True >>> float('nan') == float('nan') False >>> float('nan') != float('nan') True >>> Same behaviour as with Python 2.6.4 >>> copysign(1, float('inf')) 1.0 >>> copysign(1, float('-inf')) -1.0 >>> copysign(1, float('nan')) -1.0 >>> copysign(1, float('-nan')) <<<<<<<<<<<<<<<<<<< 1.0 >>> Different behaviour from Python 2.6.4 ---------- components: None messages: 97432 nosy: jmfauth severity: normal status: open title: Two float('nan') are not equal type: behavior versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7660> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com