RFR: 8077587: BigInteger Roots [v56]

fabioromano1 duke at openjdk.org
Tue Jul 29 14:22:06 UTC 2025


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

>> This PR implements nth root computation for BigIntegers using Newton method.
>
> fabioromano1 has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Comment

src/java.base/share/classes/java/math/MutableBigInteger.java line 2022:

> 2020:             } else { // x >> (sh-ex) could exceed finite double range, may lose precision
> 2021:                 // Shift the value into finite double range
> 2022:                 // x >> sh < 2^(bl-sh) = 2^(bl-(bl-P)) = 2^P < Double.MAX_VALUE

@rgiulietti By the comment in the then-case, I think this is sufficient to understand.

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

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


More information about the core-libs-dev mailing list