JCK 1.3 test lang/EXPR/expr348/expr34801/expr34801.html and the following
test fail under Linux and Windows OS due to the same reason.
Minus '-' is printed before zero value when float zero is transformed to string.
JDK version:
java version "1.3.1beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1beta-b08)
Java HotSpot(TM) Client VM (build 1.3.1beta-b08, mixed mode)
------------------------test.java----------------------------------------------
public class test {
public static void main(String args[]) {
float zerof = + 0.0f;
double zerod = + 0.0d;
String s=Float.toString(0.0f - zerof);
if (s.startsWith("-"))
System.out.println("Failed: "+s);
else
System.out.println("Passed: "+s);
}
}
-------------------------output-------------------------------------------------
[kotl@linux-14 ]$ java -server -Xcomp test
Failed: -0.0
[kotl@linux-14 ]$ java -client -Xcomp test
Passed: 0.0
[kotl@linux-14 ]$ java -client test
Passed: 0.0
[kotl@linux-14 ]$ java -server test
Passed: 0.0
- duplicates
-
JDK-4391116 JCK: 2 api/java_lang failures on solaris(sparc/x86), Ladybird_b08, JCK1.3
- Closed
-
JDK-4391406 JCK: incorrect result of equals() and shift operator for Float and Double
- Closed