-
Bug
-
Resolution: Fixed
-
P4
-
19, 20
Methods `Double.toString(double)` and `AbstractStringBuilder.append(double)` make use of an algorithm integrated in JDK 19 [1], replacing the one used in earlier release; similarly for the `float` counterparts `Float.toString(float)` and `AbstractStringBuilder.append(float)`.
Class `java.util.Formatter`, however, uses another algorithm to format `double` and `float` values. This can lead to small discrepancies w.r.t. the outcomes of the above methods in certain rare cases, and conflicts with the specification which is based on `Double.toString(double)`. Therefore, to match the specification, `java.util.Formatter` should replace the current algorithm with a variant of the new one tailored for formatted output.
----
[1] https://git.openjdk.java.net/jdk/commit/72bcf2aa03d53b0f68eb07a902575b4e8628d859
Class `java.util.Formatter`, however, uses another algorithm to format `double` and `float` values. This can lead to small discrepancies w.r.t. the outcomes of the above methods in certain rare cases, and conflicts with the specification which is based on `Double.toString(double)`. Therefore, to match the specification, `java.util.Formatter` should replace the current algorithm with a variant of the new one tailored for formatted output.
----
[1] https://git.openjdk.java.net/jdk/commit/72bcf2aa03d53b0f68eb07a902575b4e8628d859
- csr for
-
JDK-8301387 Align the specification of java.util.Formatter float conversions to the implementation
- Closed