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 jmfauth
Recipients jmfauth
Date 2010-01-08.19:09:18
SpamBayes Score 0.00011664694
Marked as misclassified No
Message-id <1262977760.25.0.00378314751244.issue7660@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2010-01-08 19:09:20jmfauthsetrecipients: + jmfauth
2010-01-08 19:09:20jmfauthsetmessageid: <1262977760.25.0.00378314751244.issue7660@psf.upfronthosting.co.za>
2010-01-08 19:09:18jmfauthlinkissue7660 messages
2010-01-08 19:09:18jmfauthcreate