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.
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.
- csr for
-
JDK-8370151 Correct scale handling of BigDecimal.sqrt
-
- Draft
-
- relates to
-
JDK-4851777 Add BigDecimal sqrt method
-
- Closed
-
- links to
-
Review(master) openjdk/jdk/27882