Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
https://github.com/apache/groovy/pull/762
The "scale" for BigDecimal division is hard-coded to 10 (BigDecimalMath.MAX_DIVISION_SCALE), which is fewer than the roughly equivalent 16-17 digits for double (64-bit) division. It seems like the default scale should be at least as accurate as double division. Also it is probably desirable for this setting to be configurable in some way, maybe more than one. Maybe a global Java system property setting, and then some form of context related override (per-thread, per-script, etc.).
I use this fix for 2 years without side effects on a software for a big company. For comparison, Excel use a round with 15 digit after decimal