Float.parseFloat rounding bug

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


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

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
pass tests, whereas right now the tests expect the
*wrong* behavior.)

Louis Wasserman
wasserman.louis at gmail.com

More information about the core-libs-dev mailing list