Following test[1] fails in Harmony. But passes in RI. [1] test: float r=6.0214271E18f; String s=Float.toString(r); assertEquals("6.0214271E18",s); Harmony prints: 6.021427E18 (note '1' is missing from the converted string)
When i looked into the implementation of harmony, i come to know its a limitation to the algorithm implemented in Harmony (Printing Floating-Point Numbers Quickly and Accurately, Robert G. Burger, and R. Kent Dybvig, Programming Language Design and Implementation (PLDI) 1996, pp.108-116) https://svn.apache.org/repos/asf/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/shared/dblparse.c function: java_org_apache_harmony_luni_util_NumberConverter_bigIntDigitGeneratorInstImpl I am clue-less to find the flaw in the implementation. Any comments from experts of this area? I will raise a JIRA for this issue. Thanks and Regards, Mohan