Float.parseFloat rounding bug

Louis Wasserman wasserman.louis at gmail.com
Sun Jun 17 18:31:57 UTC 2012


Hello,

I had a patch <https://bugs.openjdk.java.net/show_bug.cgi?id=100208>for this
Sun bug <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6358355>, and
was hoping it could get reviewed.  The simplest failing test case is
probably

public class Foo {
  public static void main(String[] args) {
    System.out.println(144115196665790480f <= 144115196665790481f);
  }
}

which quite surprisingly prints false.  What can I do to make this happen?

(I'm interested because once Float.parseFloat is correct, this improvement
to BigInteger.floatValue() and
doubleValue()<http://microbenchmarks.appspot.com/run/wasserman.louis@gmail.com/DoubleBenchmark>will
pass tests, whereas right now the tests expect the
*wrong* behavior.)

Louis Wasserman
wasserman.louis at gmail.com
http://profiles.google.com/wasserman.louis



More information about the core-libs-dev mailing list