On Mon, 29 Jul 2024 16:48:32 GMT, Raffaello Giulietti <rgiulie...@openjdk.org> 
wrote:

>> fabioromano1 has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   If the input is a square, then s0 == 0, so testing for non-zero remainder 
>> is redundant
>
> src/java.base/share/classes/java/math/MutableBigInteger.java line 550:
> 
>> 548:      */
>> 549:     void safeRightShift(int n) {
>> 550:         if (n >= bitLength()) {
> 
> The commit message for this reads `More accurate condition for 
> MBI.safeRightShift()`.
> If the old version works, please switch back. But if this is a genuine bug, 
> then it needs a separate bug issue and PR.

@rgiulietti The code of `MBI.safeRightShift()` works, but it seems that its 
correctness relies on the implementation of `MBI.rightShift()`, rather than on 
its own documentation or on that of  `MBI.rightShift()`. The real problem is 
that, as usual, the preconditions of `MBI.rightShift()` are not clearly 
specified.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19710#discussion_r1695677987

Reply via email to