When using the operator overloaded ```/``` to divi...
# announcements
f
When using the operator overloaded
Copy code
/
to divide big decimals the outcome is kind of unexpected:
Copy code
40.toBigDecimal() / 100.toBigDecimal()
0
40.toBigDecimal().divide(100.toBigDecimal())
0.4
This seems to be a result of
Copy code
/
using the half even rounding mode. Does anyone know why this rounding mode was chosen?
i
divide
throws
ArithmeticException
if it can't represent the result exactly. That's why we use rounding.