On Thu, 18 Jul 2024 15:22:39 GMT, Raffaello Giulietti <rgiulie...@openjdk.org> 
wrote:

>> I found the way: I can test directly the code through 
>> `java.math.Accessor.java`
>
> I think there's a misunderstanding here.
> 
> What I'd like to see is a test that verifies the claim
> 
>         /* For every long value s in [0, 2^32) such that x == s * s,
>          * it is true that s - 1 <= (long) Math.sqrt(x >= 0 ? x : x + 0x1p64) 
> <= s,
> 
> A test similar to my code above should be more than enough.

That test would not exercise any code in `MutableBigInteger` or `BigInteger`. 
It would just ensure that `MBI.ulongSqrt()` has solid foundations.

Feel free to add the test at your discretion. However, if you decide for it, 
please make sure that it describes in comments what its purpose really is.

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

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

Reply via email to