RFR: 8334755: Asymptotically faster implementation of square root algorithm [v42]

fabioromano1 duke at openjdk.org
Sat Jul 27 14:00:37 UTC 2024


On Sat, 27 Jul 2024 13:46:14 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> The benchmark `BigIntegers.java`, on which I based this, has the same problem.
>
> It wasn't the overflow by itself that worried me, but that a later invocation of `sqrt*()` could throw.
> 
> Again, the "huge" numbers are less than 2^66. You might to take a look at `shiftArray` in `BigInteger.java` for inspiration, and adding some leading `0` bits to exercise the normalization/denormalization impact.

Actually, the problem rises already when constructing the BigInteger, by invalid decimal string construction.

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

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


More information about the core-libs-dev mailing list