RFR: 8370057: Correct scale handling of BigDecimal.sqrt

Raffaello Giulietti rgiulietti at openjdk.org
Mon Oct 20 13:03:26 UTC 2025


On Fri, 17 Oct 2025 23:10:30 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> Correct scale handling of BigDecimal.sqrt to conform to IEEE 754.

Test copyright year

src/java.base/share/classes/java/math/BigDecimal.java line 2177:

> 2175:         // The code below favors relative simplicity over checking
> 2176:         // for special cases that could run faster.
> 2177:         // final int preferredScale = this.scale/2;

Can we remove this line?

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

PR Review: https://git.openjdk.org/jdk/pull/27882#pullrequestreview-3356365385
PR Review Comment: https://git.openjdk.org/jdk/pull/27882#discussion_r2444937924


More information about the core-libs-dev mailing list