RFR: 8355719: Reduce memory consumption of BigInteger.pow() [v51]
fabioromano1
duke at openjdk.org
Wed May 7 18:04:17 UTC 2025
On Wed, 7 May 2025 17:58:11 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:
> OK.
>
> But then your original expression
>
> ```
> (((bitLength() - 1L) * exponent) >>> 5) + 1L > MAX_MAG_LENGTH
> ```
>
> was a bit too restrictive as well, right?
On the contrary, it was too loose, as it admitted a bit length equal to `2^31 > Integer.MAX_VALUE`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24690#discussion_r2078197555
More information about the core-libs-dev
mailing list