BigDecimal出现java.lang.ArithmeticException Non-Terminating Decimal Expansion

错误

java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result

原因

出现无限循环小数了

解决

BigDecimal#divide(num, scale)

BigDecimal#divide(num, scale, roundingMode)

简单粗暴霸气,双击666~