RFR: 8366478: BigDecimal roots [v25]

Raffaello Giulietti rgiulietti at openjdk.org
Mon Oct 27 20:28:09 UTC 2025


On Mon, 27 Oct 2025 15:34:33 GMT, fabioromano1 <duke at openjdk.org> wrote:

>> An implementation of `BigDecimal.nthRoot(int, MathContext)`.
>
> 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?

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

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


More information about the core-libs-dev mailing list