<i18n dev> RFR: 8300869: Make use of the Double.toString(double) algorithm in java.util.Formatter

Raffaello Giulietti rgiulietti at openjdk.org
Fri Jan 27 16:18:17 UTC 2023


On Fri, 27 Jan 2023 16:02:38 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> Align `double` and `float` decimal conversions in `java.util.Formatter` with the algorithm used in `Double.toString(double)`.

The specification in `Formatter` explicitly refers to the outcome of `Double.toString(double)`. However, it currently uses another implementation for the floating-point to decimal conversion, which might end up in rare, slightly different outcomes than the ones described in the specification.

This fixes the discrepancy between specification and implementation in `Formatter`.

Class `jdk.internal.math.FormattedFPDecimal` replaces `jdk.internal.math.FormattedFloatingDecimal`, which is no longer needed.

-------------

PR: https://git.openjdk.org/jdk/pull/12259


More information about the i18n-dev mailing list