I have refer [this](https://stackoverflow.com/questions/4591206/arithmeticexception-non-terminating-decimal-expansion-no-exact-representable) and did rounding of `BigDecimal` value then also I am getting above mentioned error. Please find code mentioned below. Thanks in advance:

```
BigDecimal val1 = new BigDecimal(494.10000001).setScale(8, BigDecimal.ROUND_UP);
BigDecimal val2 = new BigDecimal(693189.38625000).setScale(8, BigDecimal.ROUND_UP);
BigDecimal result = val1.divide(val2);
System.out.println(result);

```