JDK-8370057 : Correct scale handling of BigDecimal.sqrt
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.math
  • Affected Version: 26
  • Priority: P4
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2025-10-17
  • Updated: 2025-10-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26Unresolved
Related Reports
CSR :  
Relates :  
Description
The intention of preferred scale policy of BigDecimal.sqrt is that it would follow the IEEE 754 standard policy for preferred exponent, where the scale is the negated exponent, see

https://bugs.openjdk.org/browse/JDK-4851777?focusedId=13847551&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13847551

However, the specification and implementation just use integer division by two of the scale, which will not give the same results for odd scales.
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27882 Date: 2025-10-17 23:10:30 +0000
17-10-2025