Issue1758284

classification
Title: Complex parses complex('1' * 500) as (Infinity+0j)
Type: Severity: normal
Components: Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, pjenvey, ukeshav
Priority: normal Keywords: test failure causes

Created on 2007-07-22.00:41:10 by cgroves, last changed 2008-04-07.03:59:03 by pjenvey.

Messages
msg1758 (view) Author: Charlie Groves (cgroves) Date: 2007-07-22.00:41:10
muhngole 2.3 $ jy2.3 
Jython 2.3a0 on java1.5.0_07
Type "copyright", "credits" or "license" for more information.
>>> complex('1' * 500)
(Infinity+0j)
>>> ^D
muhngole 2.3 $ python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> complex('1' * 500)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: float() out of range: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

This causes ComplexTest.test_constructor to fail.
msg1759 (view) Author: Charlie Groves (cgroves) Date: 2007-08-06.00:05:35
See http://wiki.python.org/jython/JythonDeveloperGuide/VersionTransitionTestExclusions for how to get the test running again to fix this.
msg1760 (view) Author: keshav upadhyaya (ukeshav) Date: 2007-08-20.09:51:45
i have traced the bug and found some problem in PyString.java  __complex__ function 
here the line
z = Double.valueOf(string.substring(s, end)).doubleValue();

is getting Double.POSITIVE_INFINITY value  for some case it may get Double.NEGATIVE_INFINITY tooo 

Looking more in this in deatal ..

patch will be updated soon..

msg1761 (view) Author: keshav upadhyaya (ukeshav) Date: 2007-08-20.09:52:59
i have traced the bug and found some problem in PyString.java  __complex__ function 
here the line
z = Double.valueOf(string.substring(s, end)).doubleValue();

is getting Double.POSITIVE_INFINITY value  for some case it may get Double.NEGATIVE_INFINITY tooo 

Looking more in this in deatal ..

patch will be updated soon..

msg3121 (view) Author: Philip Jenvey (pjenvey) Date: 2008-04-07.03:59:03
fixed in r4312, thanks ukeshav!
History
Date User Action Args
2008-04-07 03:59:03pjenveysetstatus: open -> closed
nosy: + pjenvey
resolution: fixed
messages: + msg3121
components: + Core, - None
2007-07-22 00:41:10cgrovescreate