Issue1762

classification
Title: float("-nan") gives ValueError instead of nan
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.5
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: fwierzbicki, pjac
Priority: normal Keywords:

Created on 2011-06-21.16:57:35 by pjac, last changed 2013-02-25.19:40:20 by fwierzbicki.

Messages
msg6557 (view) Author: Peter (pjac) Date: 2011-06-21.16:57:34
Desired behaviour in C Python 2.5,

$ python2.5
Python 2.5 (r25:51908, Nov 12 2010, 14:49:10) 
[GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> float("nan")
nan
>>> float("-nan")
nan
>>> quit()

Broken behaviour in Jython 2.5.1 on Mac,

$ jython
Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54) 
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_24
Type "help", "copyright", "credits" or "license" for more information.
>>> float("nan") 
nan
>>> float("-nan")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for __float__: -nan
>>> quit()



Broken behaviour in Jython 2.5.2 on Linux

$ ./jython 
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) 
[OpenJDK 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_17
Type "help", "copyright", "credits" or "license" for more information.
>>> float("nan") 
nan
>>> float("-nan")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for __float__: -nan
>>> quit()
msg7744 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-25.19:39:58
This is fixed in 2.7 but probably won't be in 2.5.
History
Date User Action Args
2013-02-25 19:40:20fwierzbickisetpriority: normal
assignee: fwierzbicki
2013-02-25 19:40:10fwierzbickisetresolution: fixed
2013-02-25 19:39:58fwierzbickisetstatus: open -> closed
nosy: + fwierzbicki
messages: + msg7744
versions: + Jython 2.5, - 2.5.2
2011-06-21 16:57:35pjaccreate