RFR: 8077587: BigInteger Roots [v78]

Raffaello Giulietti rgiulietti at openjdk.org
Wed Sep 3 09:42:50 UTC 2025


On Wed, 3 Sep 2025 09:38:19 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> src/java.base/share/classes/java/math/MutableBigInteger.java line 2059:
>> 
>>> 2057:                 /* The Newton's recurrence roughly duplicates the correct bits at each iteration.
>>> 2058:                  * Instead of shifting the approximate root into the original range right now,
>>> 2059:                  * we only duplicate its bit length and then refine it with Newton's recurrence,
>> 
>> Suggestion:
>> 
>>                 /* The Newton's recurrence roughly doubles the correct bits at each iteration.
>>                  * Instead of shifting the approximate root into the original range right now,
>>                  * we only double its bit length and then refine it with Newton's recurrence,
>
> In `BigIntegerTest`, the methods related to nth-root do not seem to be invoked.

If it makes your life easier, you could extract just your tests and create a new JUnit based test class.
Up to you.

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

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


More information about the core-libs-dev mailing list