[ 
https://issues.apache.org/jira/browse/JEXL-50?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12640982#action_12640982
 ] 

Sebb commented on JEXL-50:
--------------------------

Just found out: the JSP 2.0 documentation states that "/" and "div" are 
equivalent in the expression language so perhaps it is the documentation that 
is wrong.
The division will return a BigDecimal if either input is BigDecimal or 
BigInteger, but the division is rounded up.

Likewise, Velocity returns an integer if the operands are integers - but I'm 
not sure what rounding is applied.

It would be useful to have an IntegerDivide operator, but perhaps it needs a 
new token.

> Div operator does not do integer division
> -----------------------------------------
>
>                 Key: JEXL-50
>                 URL: https://issues.apache.org/jira/browse/JEXL-50
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Sebb
>
> The "div" operator behaves the same as "/" - however it should do integer 
> division according to the web-site:
> http://commons.apache.org/jexl/reference/syntax.html#Operators

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to