RFR: 4511638: Double.toString(double) sometimes produces incorrect results [v14]
Raffaello Giulietti
duke at openjdk.java.net
Wed Jun 1 10:27:43 UTC 2022
On Tue, 31 May 2022 21:55:16 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 4511638: Double.toString(double) sometimes produces incorrect results
>
> src/java.base/share/classes/jdk/internal/math/DoubleToDecimal.java line 97:
>
>> 95: private static final int MASK_28 = (1 << 28) - 1;
>> 96:
>> 97: private static final int NON_SPECIAL = 0;
>
> Would these constants be better as an enum?
An enum would make much sense if it were used by other parts of the codebase, and then it would be moved to `MathUtils`.
This might well happen in the near future, when this code could be enhanced to be used in formatting conversions, like in "`printf()`" and friends.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3402
More information about the core-libs-dev
mailing list