commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Inf


From: Sven de Marothy
Subject: [commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Infinity
Date: Thu, 07 Oct 2004 18:49:57 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922

This mail is an automated notification from the bugs tracker
 of the project: classpath.

/**************************************************************************/
[bugs #10491] Latest Modifications:

Changes by: 
                Sven de Marothy <address@hidden>
'Date: 
                Thu 10/07/2004 at 22:42 (Europe/Stockholm)

------------------ Additional Follow-up Comments ----------------------------
I've submitted a quick-fix for this to the classpath-patches list. 






/**************************************************************************/
[bugs #10491] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10491>
Project: classpath
Submitted by: 0
On: Fri 09/24/2004 at 23:47

Category:  None
Severity:  5 - Average
Resolution:  None
Privacy:  Public
Assigned to:  None
Status:  Open
Platform Version:  None


Summary:  wrong parsing behaviour of NaN, Infinity, -Infinity

Original Submission:  Classpath (CVS HEAD 09.25.04) throws a 
NumberFormatException although [+/-]NaN|Infinity are possible float/double 
values according to Java documentation.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Thu 10/07/2004 at 22:42       By: Sven de Marothy <smarothy>
I've submitted a quick-fix for this to the classpath-patches list. 

-------------------------------------------------------
Date: Thu 10/07/2004 at 16:05       By: David Gilbert <trebligd>
I've written some Mauve tests that cover these failing cases (plus some other 
non-failing cases).  I'll post them to the mauve-patches mailing list now.

-------------------------------------------------------
Date: Thu 10/07/2004 at 14:29       By: 0 <None>
Simple test cases:

try {
  if(Double.POSITIVE_INFINITY == Double.parseDouble("Infinity")) {
    // OK
  } else {
    // WRONG
  }
} catch(NumberFormatException nfe){
  // should not happen (but is what its doing now)
}

aside from the given comparison it can be replaced with:
Double.POSITIVE_INFINITY == Double.parseDouble("+Infinity")
Double.NEGATIVE_INFINITY == Double.parseDouble("-Infinity")
Double.NaN == Double.parseDouble("NaN");

Float.POSITIVE_INFINITY == Float.parseFloat("+Infinity")
Float.NEGATIVE_INFINITY == Float.parseFloat("-Infinity")
Float.NaN == Float.parseFloat("NaN");

for all examples the string may contain whitespace before and after the 'word'.












For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10491>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]