RFR: 4511638: Double.toString(double) sometimes produces incorrect results [v14]

Brian Burkhalter brian.burkhalter at oracle.com
Wed Jun 1 15:36:41 UTC 2022



> On Jun 1, 2022, at 3:32 AM, Raffaello Giulietti <duke at openjdk.java.net> wrote:
> 
> On Tue, 31 May 2022 22:11:54 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/FloatToDecimal.java line 97:
>> 
>>> 95:     private static final int MASK_28 = (1 << 28) - 1;
>>> 96: 
>>> 97:     private static final int NON_SPECIAL    = 0;
>> 
>> As these are shared with `DoubleToDecimal` would these constants be better moved to a common location, e.g., `MathUtils` whether converted to an `enum` or not?
> 
> As long as the values are constant `ints`, moving them to `MathUtils` is less robust. Changing any value would require remembering to recompile the "clients".
> The move would make sense if these were an enum.
> 
> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/3402

Understood. All of that can wait until later.


More information about the core-libs-dev mailing list