File tree Expand file tree Collapse file tree
src/java.base/share/classes/java/math Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1372,10 +1372,15 @@ static BigDecimal zeroValueOf(int scale) {
13721372 * by the {@link Double#toString(double)} method.
13731373 *
13741374 * @apiNote This is generally the preferred way to convert a
1375- * {@code double} (or {@code float}) into a {@code BigDecimal}, as
1375+ * {@code double} into a {@code BigDecimal}, as
13761376 * the value returned is equal to that resulting from constructing
13771377 * a {@code BigDecimal} from the result of using {@link
13781378 * Double#toString(double)}.
1379+ * <p>
1380+ * While a {@code float} argument {@code v} can be passed to this method,
1381+ * the result often contains many more trailing digits than the precision
1382+ * of a {@code float}.
1383+ * Consider using {@code new BigDecimal(Float.toString(v))} instead.
13791384 *
13801385 * @param val {@code double} to convert to a {@code BigDecimal}.
13811386 * @return a {@code BigDecimal} whose value is equal to or approximately
You can’t perform that action at this time.
0 commit comments