RFR: 8334755: Asymptotically faster implementation of square root algorithm [v5]
Daniel Jeliński
djelinski at openjdk.org
Sun Jun 23 09:51:09 UTC 2024
On Sun, 23 Jun 2024 08:55:17 GMT, fabioromano1 <duke at openjdk.org> wrote:
> why the documentation does not specify that the method assumes the arguments are normalized?
Well, the best answer I can offer is "because no one documented it yet". `MutableBigInteger` is an internal class, so most people never see its documentation.
> And why the method subtract(MutableBigInteger) does not call normalize() on arguments before calling compare(MutableBigInteger)? Does subtract assume implicitly that the arguments are normalized too?
Most likely. If you check the code you'll notice that most methods that change the `MutableBigInteger` value (like `subtract`) call `normalize` after performing the operation, so the values should be normalized most of the time.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19710#discussion_r1650032491
More information about the core-libs-dev
mailing list