You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2023/11/28 09:23:00 UTC

[jira] [Updated] (JEXL-417) JexlArithmetic looses precision during arithmetic operator execution

     [ https://issues.apache.org/jira/browse/JEXL-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro updated JEXL-417:
-------------------------------
    Description: 
When a an argument/variable is a BigDecimal or BigInteger, JEXL may try and convert it to double/long during arithmetic operator execution leading to unexpected results.

See [discussion|https://lists.apache.org/thread/h673m554ncjg06f5pqhjjtvy1qk3o2jt]
{code:java}(56.1B - 12) / 12 = 3.66666B != 3{code}

User intent about precision should be maintained.

  was:
When a an argument/variable is a BigDecimal or BigInteger, JEXL may try and convert it to double/long during arithmetic operator execution leading to unexpected results.

See [discussion|https://lists.apache.org/thread/h673m554ncjg06f5pqhjjtvy1qk3o2jt]
{code:java}
(56.1B - 12) / 12 = 3.66666B != 3 
 {code}

User intent about precision should be maintained.


> JexlArithmetic looses precision during arithmetic operator execution
> --------------------------------------------------------------------
>
>                 Key: JEXL-417
>                 URL: https://issues.apache.org/jira/browse/JEXL-417
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.3
>            Reporter: Henri Biestro
>            Priority: Major
>             Fix For: 3.3.1
>
>
> When a an argument/variable is a BigDecimal or BigInteger, JEXL may try and convert it to double/long during arithmetic operator execution leading to unexpected results.
> See [discussion|https://lists.apache.org/thread/h673m554ncjg06f5pqhjjtvy1qk3o2jt]
> {code:java}(56.1B - 12) / 12 = 3.66666B != 3{code}
> User intent about precision should be maintained.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)