« Return to Thread: Float.parseFloat rounding bug

Float.parseFloat rounding bug

by Arkleseizure :: Rate this Message:

| View in Thread

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

Louis Wasserman
wasserman.louis@...
http://profiles.google.com/wasserman.louis

 « Return to Thread: Float.parseFloat rounding bug