RFR: 8366478: BigDecimal roots [v9]
fabioromano1
duke at openjdk.org
Mon Oct 27 11:09:08 UTC 2025
On Mon, 27 Oct 2025 05:03:29 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> > I'm also wondering if we should restrict n to |n| ≤ 999'999'999, as in pow(). This would allow users of BigDecimal to implement corrective actions, as in the schema above, by themselves.
>
> The pow limit was a carry-over some another language environment where an earlier version of this decimal support for implemented. I don't regard it as a strong precedent for us to follow here is we can have a very-wide range of n without much difficulty.
I would suggest removing that restriction from `BigDecimal.pow()` altogether, as `BigInteger.pow()` already performs check for overflow.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27148#issuecomment-3450728851
More information about the core-libs-dev
mailing list