harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Li" <liyilei1...@gmail.com>
Subject [classlib][luni]Double.toString gets different result from RI
Date Fri, 29 Sep 2006 06:31:09 GMT
Hi,all:
    I find one testcase of DoubleTest fails on RI. After digging into it, I
find that it is due to the different behaviors of Double.toString between
Harmony and RI.
    Here is a testcase:
    public class DoubleTest extends TestCase {
    public void test_toString(){
        String actual = Double.toString(1e23D);
        String expected = "9.999999999999999E22";
        assertEquals(expected,actual);
    }
}
   Because of the limitation of double/float's precision, different numbers
are mapped to the same double value. So I think it is the different
implementation that lead to the different toString() result which represents
different original number before mapping. Thus it can be regarded as a
non-bug difference between RI and Harmony and I recommend to remove the
testcase.

Result
RI:  Pass
HR:  Fail


-- 
Leo Li
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message