[jboss-jira] [JBoss JIRA] (DROOLS-2391) Cannot compare int's division result to double

Mario Fusco (JIRA) issues at jboss.org
Tue Mar 27 12:01:01 EDT 2018


     [ https://issues.jboss.org/browse/DROOLS-2391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mario Fusco resolved DROOLS-2391.
---------------------------------
    Resolution: Done


Fixed in mvel 2.4.1 with https://github.com/mvel/mvel/commit/74d70ffe550fa2f1ab3948435774183fe3767d41

> Cannot compare int's division result to double
> ----------------------------------------------
>
>                 Key: DROOLS-2391
>                 URL: https://issues.jboss.org/browse/DROOLS-2391
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 7.4.1.Final
>            Reporter: Viacheslav Krot
>            Assignee: Luca Molteni
>
> I guess this is a bug - division of int fields in when part cannot be compared to double.
> For example with class A having two int fields following rule does not work
> when
>   $a: A(a == 1, b == 2, a / b < 0.99)
> but this works:
> when
>   $a: A(a == 1, b == 2, a / b < 1.0)
> Result of same expresson printed to output - System.out.println($a.a / $a.b) gives correct result of type Double.
> Why does it not work in when part?



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list