On Tue, 26 Nov 2024 17:31:38 GMT, Raffaello Giulietti <rgiulie...@openjdk.org> wrote:
>>> I don't get your point. Here's an example: >>> >>> ``` >>> BigDecimal.ONE.sqrt(new MathContext(2_000_000_000, RoundingMode.UP)) >>> | Exception java.lang.ArithmeticException: Overflow >>> | at BigDecimal.sqrt (BigDecimal.java:2226) >>> | at (#4:1) >>> ``` >> >> Yes, that's correct indeed, I was wrongly assuming that `this.precision() >= >> minWorkingPrec`. > > Also consider that my recent example works fine in the current > implementation, returning 1. This might be due to the special treatment of powers of 10 radicands in the current implementation. I think we can forget about special cases, so I'd say that there's no need to reconsider your implementation. Before approving, however, I'll check with the original implementor. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21301#discussion_r1858991912