RFR: 8355719: Reduce memory consumption of BigInteger.pow() [v51]
Raffaello Giulietti
rgiulietti at openjdk.org
Wed May 7 18:12:41 UTC 2025
On Wed, 7 May 2025 18:01:24 GMT, fabioromano1 <duke 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?
>
>> 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 `MAX_MAG_LENGTH * Integer.SIZE == 2^31 > Integer.MAX_VALUE`.
I mean, if B strictly implies A, then B is more restrictive (stronger).
Since B is equivalent to your original formulation, to me it means that it was more restrictive.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24690#discussion_r2078218931
More information about the core-libs-dev
mailing list