使用BigDecimal报的错

错误:java.lang.arithmeticexception: non-terminating decimal expansion; no exact representa  小数位膨胀 

解决方法:(截取相应的位数)

  1. BigDecimal result = x.divide(y, 3, BigDecimal.ROUND_HALF_UP)

  

原文地址:https://www.cnblogs.com/lzj123/p/7149687.html