RFR: 4511638: Double.toString(double) sometimes produces incorrect results
github.com+70726043+rgiulietti at openjdk.java.net
Fri Apr 9 16:36:08 UTC 2021
On Thu, 8 Apr 2021 21:20:34 GMT, Raffaello Giulietti <github.com+70726043+rgiulietti at openjdk.org> wrote:
>> here's a PR for a patch submitted on March 2020 (https://cr.openjdk.java.net/~bpb/4511638/webrev.04/) when Mercurial was a thing.
>> The patch has been edited to adhere to OpenJDK code conventions about multi-line (block) comments. Nothing in the code proper has changed, except for the addition of redundant but clarifying parentheses in some expressions.
> Forgot to add that other changes in the code are the use of switch expressions and the use of instanceof patterns.
here's some background information for those that didn't follow the mailing list for the last couple of years.
Some enjoyable properties of the novel algorithm:
* No intermediate objects are instantiated.
* Loop-free core algorithm.
* Only int and long arithmetic.
* No divisions at all.
* 17.7x speedup (jmh) (https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-April/065921.html).
* Randomized, yet reproducible deep diving tests (jtreg).
* Clear, unambiguous spec.
* All floats have been tested to fully meet the spec.
* Fully documented in (https://drive.google.com/file/d/1luHhyQF9zKlM8yJ1nebU0OgVYhfC6CBN/view) and/or in comments.
See (https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-September/062580.html) for some (invented) Q&A. The last Q&A deals with your investment in time for an informed review.
More information about the core-libs-dev