Code review request for 4900206 "Include worst-case rounding tests for Math library functions"

Dmitry Nadezhin dmitry.nadezhin at gmail.com
Thu Aug 11 17:54:10 UTC 2011


Your fix adds worst-case rounding tests for math functions.

It may also be useful to include worst-case rounding tests for number
conversions (string-to-double).

I have explored string-to-double issues, including problems when the
converted numbers are close to the breakpoints between doubles.  This
happens when the string is (m + 0.5 + eps)*2^exp

I found three relevant test cases:

1) The shortest string with eps = 0
"1e23" = 0x1.52d02c7e14af6p76 + (0.5 + 0.0)*1p24

2) The minimum positive eps = 2.1546568143020914E-19
"3743626360493413e-165" = 0x1.8823a57adbef9p-497 + (-0.5 +
2.1546568143020914E-19)*1p-549

3) The maximum negative eps = -8.318563789335443E-19
"1864950924021923e213" = 0x1.3ae60753af6cap758 + (0.5 +
-8.318563789335443E-19)*1p706


These examples may be useful for testing Double.parseDouble and
Double.toString

  -Dmitry

On Thu, Aug 11, 2011 at 1:24 AM, Joe Darcy <joe.darcy at oracle.com> wrote:

> Hello.
>
> Cleaning up my bug backlog, please review the addition of some new math
> library tests:
>
>    4900206 "Include worst-case rounding tests for Math library functions"
>    http://cr.openjdk.java.net/~**darcy/4900206.0/<http://cr.openjdk.java.net/%7Edarcy/4900206.0/>
>
> These tests probe at hard to round values generated by number-theoretic
> techniques.  I've verified the tests pass on Linux x86 and Solaris sparc.
>
> Thanks,
>
> -Joe
>



More information about the core-libs-dev mailing list