RFR: 8077587: BigInteger Roots [v81]

Joe Darcy darcy at openjdk.org
Fri Sep 5 03:40:17 UTC 2025


On Thu, 4 Sep 2025 08:45:33 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:
> 
>   Small optimization and format comments

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

> 172:         // to the formulae in JLS, Section 20.10.22.
> 173:         long valBits = Double.doubleToRawLongBits(val);
> 174:         int exponent = (int) ((valBits >> 52) & 0x7ffL) - 1075;

Hmm. I'd prefer to see Math.getExponent() used here.

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

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


More information about the core-libs-dev mailing list