Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 47138 invoked from network); 20 Oct 2008 11:42:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Oct 2008 11:42:36 -0000 Received: (qmail 20410 invoked by uid 500); 20 Oct 2008 11:42:37 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 20341 invoked by uid 500); 20 Oct 2008 11:42:37 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 20330 invoked by uid 99); 20 Oct 2008 11:42:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 04:42:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 11:41:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 53AE8234C21D for ; Mon, 20 Oct 2008 04:41:44 -0700 (PDT) Message-ID: <229763109.1224502904341.JavaMail.jira@brutus> Date: Mon, 20 Oct 2008 04:41:44 -0700 (PDT) From: "Sebb (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (JEXL-50) Div operator does not do integer division In-Reply-To: <1178974292.1224499664713.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ 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.