On Sat, 10 May 2025 16:41:17 GMT, fabioromano1 <[email protected]> wrote:
> Some changes in `Biginteger`s' bit operations that increase the code
> readability and slightly optimize the execution time.
src/java.base/share/classes/java/math/BigInteger.java line 2642:
> 2640: }
> 2641: // (this.abs().bitLength() - 1L) * exponent + 1L >
> Integer.MAX_VALUE
> 2642: if (scaleFactor + bitsToShift - exponent >= Integer.MAX_VALUE) {
If this is overflow sensitive code, should this avoid adding on the left hand
side?
Suggestion:
if (scaleFactor - exponent >= Integer.MAX_VALUE - bitsToShift) {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25166#discussion_r2083701393