Lenient BigDecimal division
|Reported by:||pcampalani||Owned by:||pcampalani|
|Keywords:||bigdecimal rounding division||Cc:|
In some parts of the code, division of BigDecimal is done without specifying a rounding mode to avoid exeption on non strictly exact values.
From Java API:
In the case of divide, the exact quotient could have an infinitely long decimal expansion; for example, 1 divided by 3. If the quotient has a nonterminating decimal expansion and the operation is specified to return an exact result, an ArithmeticException is thrown. Otherwise, the exact result of the division is returned, as done for other operations.
All divisions should be made linient through the code, like is done already, e.g. see CrsUtil class.