Short answer
Use BigDecimal whenever exact decimal arithmetic matters — money, billing, tax, anything user-facing where 0.1 + 0.2 must equal 0.3.
Explanation
The common mistake is new BigDecimal(0.1), which captures the inexact binary double; you must use new BigDecimal("0.1") or BigDecimal.valueOf(0.1) to get the exact decimal. Also set an explicit scale and RoundingMode on divide(), or it throws ArithmeticException on non-terminating results.
Common mistakes
- Constructing BigDecimal from a double (new BigDecimal(0.1)) instead of a String or BigDecimal.valueOf.
- Comparing BigDecimals with equals when scale differs (2.0 vs 2.00); use compareTo.