🌐
Medium
medium.com › @skywalkerhunter › fix-divide-java-math-bigdecimal-int-in-java-math-bigdecimal-has-been-deprecated-and-why-22fe83b07e9
Fix — divide(java.math.BigDecimal,int) in java.math.BigDecimal has been deprecated — And WHY | by Oli H. | Medium
July 18, 2020 - divide(total, BigDecimal.ROUND_HALF_UP) Press enter or click to view image in full size · A real example. Step #4 — How about the setScale? Warning:(47, 146) java: setScale(int,int) in java.math.BigDecimal has been deprecated · Same trick, search for: BigDecimal.ROUND_HALF_UP ·
🌐
GeeksforGeeks
geeksforgeeks.org › java › bigdecimal-divide-method-in-java-with-examples
BigDecimal divide() Method in Java with Examples - GeeksforGeeks
July 12, 2025 - There are five overloads of divide ... roundingMode) Note: The method divide(BigDecimal divisor, int roundingMode) is deprecated since Java 9....
🌐
Oracle
docs.oracle.com › en › java › javase › 23 › docs › api › java.base › java › math › BigDecimal.html
BigDecimal (Java SE 23 & JDK 23)
October 17, 2024 - Deprecated. The method divide(BigDecimal, int, RoundingMode) should be used in preference to this legacy method.
🌐
Oracle
docs.oracle.com › javase › 9 › docs › api › java › math › BigDecimal.html
BigDecimal (Java SE 9 & JDK 9 )
... ArithmeticException - if divisor is zero, roundingMode==RoundingMode.UNNECESSARY and the specified scale is insufficient to represent the result of the division exactly. ... Deprecated. The method divide(BigDecimal, RoundingMode) should be used in preference to this legacy method.
🌐
OpenJDK
bugs.openjdk.org › browse › CCC-4943627
Deprecate rounding mode integer constants in BigDecimal ...
diff -r 92280897299f src/java.base/share/classes/java/math/BigDecimal.java --- a/src/java.base/share/classes/java/math/BigDecimal.java Mon Apr 18 14:10:14 2016 -0700 +++ b/src/java.base/share/classes/java/math/BigDecimal.java Mon Apr 18 18:41:03 2016 -0700 @@ -1536,7 +1536,7 @@ * be performed to generate a result with the specified scale, the * specified rounding mode is applied. * - * <p>The new {@link #divide(BigDecimal, int, RoundingMode)} method + * @deprecated The method {@link #divide(BigDecimal, int, RoundingMode)} * should be used in preference to this legacy method.
🌐
Coderanch
coderanch.com › t › 785638 › java › Replacing-BigDecimal-Code-Deprecated
Replacing some BigDecimal Code since Deprecated (Java in General forum at Coderanch)
Note that when a method or class is deprecated, a good first place to look for more information is in the JavaDoc for the deprecated code. In this case, that's here: BigDecimal.setScale(int,int) containing the following advice:
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › math › BigDecimal.html
BigDecimal (Java SE 11 & JDK 11 )
January 20, 2026 - Returns a BigDecimal whose value ... is inexact but the rounding mode is UNNECESSARY. ... Deprecated. The method divide(BigDecimal, int, RoundingMode) should be used in preference to this legacy method....
🌐
Oracle
docs.oracle.com › javase › 10 › docs › api › java › math › BigDecimal.html
BigDecimal (Java SE 10 & JDK 10 )
Returns a BigDecimal whose value ... is inexact but the rounding mode is UNNECESSARY. ... Deprecated. The method divide(BigDecimal, int, RoundingMode) should be used in preference to this legacy method....
Find elsewhere
🌐
Openbravo
issues.openbravo.com › view.php
0037966: JDK 9: fix new BigDecimal related deprecation warnigns - Openbravo Issue Tracking System
JDK9 deprecated some constants in BigDecimal class related to rounding which are commonly used with the setScale & divide functions.However a simple replacement of the old constants with the new ...
🌐
Oracle
docs.oracle.com › en › java › javase › 22 › docs › api › java.base › java › math › BigDecimal.html
BigDecimal (Java SE 22 & JDK 22)
July 16, 2024 - Deprecated. The method divide(BigDecimal, int, RoundingMode) should be used in preference to this legacy method.
🌐
Oracle
docs.oracle.com › en › java › javase › 24 › docs › api › java.base › java › math › BigDecimal.html
BigDecimal (Java SE 24 & JDK 24)
July 15, 2025 - Deprecated. The method divide(BigDecimal, int, RoundingMode) should be used in preference to this legacy method.
🌐
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.base › java › math › BigDecimal.html
BigDecimal (Java SE 21 & JDK 21)
January 20, 2026 - Returns a BigDecimal whose value is (this × multiplicand), with rounding according to the context settings. ... Deprecated. The method divide(BigDecimal, int, RoundingMode) should be used in preference to this legacy method.
🌐
Apache JIRA
issues.apache.org › jira › browse › NUMBERS-83
[NUMBERS-83] Replace usage of methods deprecated in Java 9 - ASF Jira
commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/BigFraction.java:[585,41] divide(java.math.BigDecimal,int,int) in java.math.BigDecimal has been deprecated · commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/PlaneAngle.java:[116,45] Double(double) ...
🌐
Tabnine
tabnine.com › home page › code › java › com.ibm.icu.math.bigdecimal
com.ibm.icu.math.BigDecimal.divide java code examples | Tabnine
*/ @Deprecated public static BigDecimal toBigDecimalTrunc(BigDecimal universalTime, int timeScale) { TimeScaleData data = getTimeScaleData(timeScale); BigDecimal units = new BigDecimal(data.units); BigDecimal epochOffset = new BigDecimal(data.epochOffset); return universalTime.divide(units, BigDecimal.ROUND_DOWN).subtract(epochOffset); } }
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › math › BigDecimal.html
BigDecimal (Java SE 17 & JDK 17)
January 20, 2026 - Returns a BigDecimal whose value is (this × multiplicand), with rounding according to the context settings. ... Deprecated. The method divide(BigDecimal, int, RoundingMode) should be used in preference to this legacy method.
🌐
GitHub
github.com › openjdk › jdk16 › blob › master › src › java.base › share › classes › java › math › BigDecimal.java
jdk16/src/java.base/share/classes/java/math/BigDecimal.java at master · openjdk/jdk16
@Deprecated(since="9") public BigDecimal divide(BigDecimal divisor, int scale, int roundingMode) { if (roundingMode < ROUND_UP || roundingMode > ROUND_UNNECESSARY) throw new IllegalArgumentException("Invalid rounding mode"); if (this.intCompact != INFLATED) { if ((divisor.intCompact != INFLATED)) { return divide(this.intCompact, this.scale, divisor.intCompact, divisor.scale, scale, roundingMode); } else { return divide(this.intCompact, this.scale, divisor.intVal, divisor.scale, scale, roundingMode);
Author   openjdk