[PATCH] Sunbug 7131192: Optimize BigInteger.doubleValue(), floatValue()

Louis Wasserman wasserman.louis at gmail.com
Sat Jul 14 12:32:07 UTC 2012

Understood.  FYI, testing for this change revealed a bug in
Float.parseFloat, a patch for which has been separately sent to this
mailing list under the subject line "[PATCH] Sunbug 6358355: Rounding error
in Float.parseFloat".  (As a result, the BigInteger patch may fail some of
the provided tests at the moment, but that is truly because the reference
implementation it's being tested against is faulty.)

Louis Wasserman
wasserman.louis at gmail.com

On Sat, Jul 14, 2012 at 2:20 AM, Joseph Darcy <joe.darcy at oracle.com> wrote:

> Hello,
> Thanks for the patch Louis.
> On 7/12/2012 3:21 AM, Andrew Haley wrote:
>> On 07/12/2012 10:32 AM, Louis Wasserman wrote:
>>> It was attached to the previous message?  I don't know if this list works
>>> with attachments.  Alternately, the patch was attached here:
>>> https://bugs.openjdk.java.net/**show_bug.cgi?id=100222<https://bugs.openjdk.java.net/show_bug.cgi?id=100222>
>>> I'm not sure what you mean by double-rounding bugs, though.  It's
>>> not difficult to actually implement the HALF_EVEN rounding behavior
>>> with bit twiddling.
>> Sure, as long as you've thought about it and done it carefully.  The
>> bit twiddling is easy to do, and easy to get wrong.
>> > From the supplied patch it looks like you've done a good job, but
>> there was no way to tell without it.  I presume the listserv dropped
>> it on the floor.
>> Andrew.
> I've taken a quick look at the patch.  The concept for the change is good;
> the current path of converting to float/double through a string is a simple
> but very roundabout way to accomplish this task.
> Unfortunately, I'm saturated with the JDK bug migration [1] and will
> continue to be saturated for at least several more weeks so I won't be able
> to take a more detailed look at the patch for a while.  I suspect some more
> directly test cases will be needed to test tricky rounding situations.
> Thanks,
> -Joe
> [1] https://blogs.oracle.com/**darcy/entry/moving_monarchs_**dragons<https://blogs.oracle.com/darcy/entry/moving_monarchs_dragons>

More information about the core-libs-dev mailing list