You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2018/07/03 09:56:00 UTC

[jira] [Commented] (GROOVY-8679) BigDecimalMath.MAX_DIVISION_SCALE is hard-coded

    [ https://issues.apache.org/jira/browse/GROOVY-8679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531132#comment-16531132 ] 

Daniel Sun commented on GROOVY-8679:
------------------------------------

As a side note, I leave the "scale" as it is(i.e. 10) on the 2.5 branch.

> BigDecimalMath.MAX_DIVISION_SCALE is hard-coded
> -----------------------------------------------
>
>                 Key: GROOVY-8679
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8679
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.5.1, 3.0.0-alpha-4
>
>
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)