RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v10]
Andy Goryachev
angorya at openjdk.org
Fri Feb 20 23:28:43 UTC 2026
On Fri, 20 Feb 2026 23:18:18 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> so this is basically an invalid test, right?
>>
>>
>> jshell> var a = 0.19999999999999998335;
>> a ==> 0.19999999999999998
>
> In contrast to a `long` literal, a `double` literal can have any number of digits. The value of the literal is then determined by the IEEE-754 round-to-nearest and ties-to-even rule (like in this algorithm). This is why the literal `0.19999999999999998335` has a value of 0.19999999999999998 (the nearest representable value). For comparison, the literal `0.19999999999999997` also has the value 0.19999999999999998.
Right, but we are not testing a double literal. We are testing the equivalence to `Double.parseDouble()`, correct?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2835482660
More information about the openjfx-dev
mailing list