RFR: 8366478: BigDecimal roots

Raffaello Giulietti rgiulietti at openjdk.org
Fri Oct 24 10:23:47 UTC 2025


On Thu, 23 Oct 2025 19:38:25 GMT, fabioromano1 <duke at openjdk.org> wrote:

>> @rgiulietti
>>> * How much code would be needed to attain correct rounding in all modes?
>> 
>> I found a way to make the procedure for correct rounding deterministic, but it would complicate the code a lot, and of course it would be potentially expensive in terms of running time, since the number of additional digits to compute is finite but not bounded by a constant. So, if it were to be implemented, I think the choice to have a correct rounding should be left to the user.
>
>> @fabioromano1 Shall I file a name change for the `BigInteger` nth root, or would you prefer to do that yourself? I'm fine with both variants.
> 
> I'm fine if you do that.

@fabioromano1 The `sqrt()` implementation incorrectly invokes nth root with the old name.

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

PR Comment: https://git.openjdk.org/jdk/pull/27148#issuecomment-3442375680


More information about the core-libs-dev mailing list