[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Inf
From: |
anonymous |
Subject: |
[commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Infinity |
Date: |
Thu, 07 Oct 2004 10:36:16 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.3) Gecko/20040930 |
This mail is an automated notification from the bugs tracker
of the project: classpath.
/**************************************************************************/
[bugs #10491] Latest Modifications:
Changes by: Anonymous user
Date:
Thu 10/07/2004 at 10:29
------------------ Additional Follow-up Comments ----------------------------
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'.
/**************************************************************************/
[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 19: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 10: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/
- [commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Infinity,
anonymous <=
- [commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Infinity, David Gilbert, 2004/10/07
- [commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Infinity, Sven de Marothy, 2004/10/07
- [commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Infinity, Sven de Marothy, 2004/10/08
- [commit-cp] [bugs #10491] wrong parsing behaviour of NaN, Infinity, -Infinity, Sven de Marothy, 2004/10/10