On Fri, 20 Feb 2026 22:54:01 GMT, Andy Goryachev <[email protected]> wrote:

>> 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

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.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2835453839

Reply via email to