RFR: 8366478: BigDecimal roots [v25]

fabioromano1 duke at openjdk.org
Mon Oct 27 20:50:15 UTC 2025


On Mon, 27 Oct 2025 20:23:39 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> fabioromano1 has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update method name in comments
>
> src/java.base/share/classes/java/math/BigDecimal.java line 2169:
> 
>> 2167:      * {@code ZERO}, {@code ZERO.rootn(n, mc).equals(ZERO)} is true with
>> 2168:      * any {@code MathContext} as an argument.
>> 2169:      * </ul>
> 
> Why does ZERO deserves a discussion as a special case? Isn't ZERO already covered by the general contract?

Simply to mimic `sqrt()` spec, no particular reason.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27148#discussion_r2467034526


More information about the core-libs-dev mailing list