I want to make comments to this change from point of view of the post
"BigInteger.bitLength() can return negative results".

Suppose that the range of valid BigInteger is restiricted either to
[-2^Integer.MAX_VALUE , 2^Integer.MAX_VALUE-1]
or to
[-2^Integer.MAX_VALUE+1, 2^Integer.MAX_VALUE-1].

In this case the exact result of x.shiftRight(Integer.MIN_VALUE)
will be 0 for x==0;
will be out of BigInteger range for any x != 0.

The exact result of x.shiftLeft(Integer.MIN_VALUE)
will be 0 for any valid x >= 0;
and will be -1 for any valid x < 0.

So it seems to me that x.shiftLeft(Integer.MIN_VALUE) should never throw ArithmeticException and x.shiftRight(Integer.MIN_VALUE) should throw ArithmeticException only when x is nonzero.

 -Dima

Reply via email to