commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] Commented: (JEXL-50) Div operator does not do integer division
Date Mon, 20 Oct 2008 11:41:44 GMT


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:
>             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:

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

View raw message