On Sat, 26 Apr 2025 19:24:21 GMT, fabioromano1 <d...@openjdk.org> wrote:
> It seems your new `unsignedIntPow` already covers `base.mag.length == 1` case > - your `unsignedLongPow` and `unsignedIntPow` are otherwise identical. Can we > just remove this long shortcut and `unsignedLongPow` and use the newly > established `unsignedIntPow`? That can also remove lots of redundant code and > significantly reduce maintenance cost. (Unless BigInteger.multiply(long) is > much cheaper than BigInteger.multiply(BigInteger)) An alternative solution is to simply throw away `unsignedIntPow()` and use always BigInteger arithmetic when the result could exceed a the `long` bits size. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24690#discussion_r2061559369