RFR: 8077587: BigInteger Roots [v56]

Raffaello Giulietti rgiulietti at openjdk.org
Tue Jul 29 14:48:06 UTC 2025


On Tue, 29 Jul 2025 14:38:40 GMT, fabioromano1 <duke at openjdk.org> wrote:

>> Here we have a kind of opposite case: rad can become very imprecise, up to losing all bits from x and become 0.
>> I think this deserves a quick comment.
>
>> Here we have a kind of opposite case: rad can become very imprecise, up to losing all bits from x and become 0. I think this deserves a quick comment.
> 
> Later there is `rad = Math.nextUp(rad)`, that ensures `rad > 0.0`.

Sure.

But L.2024-25 read

                // Complete the shift to a multiple of n,
                // avoiding to lose more bits than necessary.

which is a bit misleading, as it seems there's some hope that some bits can be preserved, which is not completely true.

The comment can be as succinct as a one liner, so it is worthwhile IMO.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24898#discussion_r2240102989


More information about the core-libs-dev mailing list