On Fri, 12 Jul 2024 14:39:51 GMT, Raffaello Giulietti <rgiulie...@openjdk.org> 
wrote:

>> The full explanation for the unnormalization is in the second paper, "A 
>> proof of GMP square root", par. 3.2 at page 11.
>
> Well, I have to compare that section, which is clear to me, with the code 
> again.

@rgiulietti I noticed that, after this unnormalization, while the square root 
can't have leading zeros by construction, the remainder could have them. 
Although there's not a general contract of the class MutableBigInteger that 
imposes the results must be always normalized (in the sense of 
`MBI.isNormalized()`), this might be an issue if `MBI.sqrtRem()` were used to 
do intermediate computations with MutableBigIntegers.

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

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

Reply via email to