RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v10]
Andy Goryachev
angorya at openjdk.org
Fri Feb 20 22:56:36 UTC 2026
On Fri, 20 Feb 2026 01:31:18 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> I've added these tests. The reason why `assertSameDouble(0.19999999999999998335, "0.19999999999999998335")` fails is because there are more digits in the number than fit in a `long`, and thus the actual number being parsed is truncated.
>
> Interestingly, the test passes if we use Lemire's algorithm with the truncated significand instead of using the fallback. This might be a coincidence.
so this is basically an invalid test, right?
jshell> var a = 0.19999999999999998335;
a ==> 0.19999999999999998
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2835404935
More information about the openjfx-dev
mailing list