RFR: 8358804: Improve the API Note of BigDecimal.valueOf(double)

Brian Burkhalter bpb at openjdk.org
Fri Jun 13 17:42:41 UTC 2025


On Fri, 13 Jun 2025 15:21:38 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> Documenting a suggestion for `float` arguments.

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

> 1381:      * the result usually contains too many trailing digits compared
> 1382:      * to the precision of a {@code float}.
> 1383:      * Consider using {@code new BigDecimal(Float.toString(v))} instead.

Perhaps move "Consider using" to the previous line; otherwise, looks fine.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25805#discussion_r2145650829


More information about the core-libs-dev mailing list