Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Nov 2007 09:50:02 +0100 Received: by mail.proteosys.com (8.13.8/8.13.4) with ESMTP id lA88nlx4022813 for ; Thu, 8 Nov 2007 09:49:47 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id lA88gO9D021028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Nov 2007 09:42:25 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id lA7N1Dl7027114; Thu, 8 Nov 2007 09:43:00 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.0) with spool id 190109 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 8 Nov 2007 09:42:59 +0100 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id lA88WxMb018385 for ; Thu, 8 Nov 2007 09:32:59 +0100 Received: from mailer2.silverstroke.com (mailer1.silverstroke.com [195.124.154.146]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id lA88VO0p021743 for ; Thu, 8 Nov 2007 09:31:29 +0100 Received: from localhost (localhost [127.0.0.1]) by mailer2.silverstroke.com (Silverstroke mailrelay) with ESMTP id F096285EC7 for ; Thu, 8 Nov 2007 09:30:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at silverstroke.com Received: from mailer2.silverstroke.com ([127.0.0.1]) by localhost (mailer2.silverstroke.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MVdi7SmZqbcH for ; Thu, 8 Nov 2007 09:30:06 +0100 (CET) Received: from s-yellow.net.silverstroke.de (s-yellow.net.silverstroke.de [172.16.20.5]) by mailer2.silverstroke.com (Silverstroke mailrelay) with ESMTP id BFDB985EC6 for ; Thu, 8 Nov 2007 09:30:06 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.0.6619.12 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Bug in \int_div_truncate_raw:nn Thread-Index: Acgh4ZDyRqGqlPPpRwmG+5m9DRcx3A== Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id lA88WxMb018386 Message-ID: <9343542E664B894484613D106D7D3F5F84AAE9@s-yellow.net.silverstroke.de> Date: Thu, 8 Nov 2007 09:30:06 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Jonathan Sauer Subject: Bug in \int_div_truncate_raw:nn To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -2.599 () BAYES_00 X-Scanned-By: MIMEDefang 2.57 on 213.139.130.197 Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 08 Nov 2007 08:50:02.0607 (UTC) FILETIME=[59FCF7F0:01C821E4] Status: R X-Status: X-Keywords: X-UID: 5070 Hello, I hope this is the right place for this. Macro \int_div_truncate_raw:nn is defined in file l3int as: \def_new:Npn \int_div_truncate_raw:nn #1#2 { \int_eval:n{ (2*#1 - #2) / (2* #2) } } If #1 is zero and #2 is two, this macro does not expand to zero, as one would expect (0 / 2 = 0), but to -1 (since eTeX rounds negative numbers by negating them, rounding the positive number and negating the result. See function "quotient" in etex.ch). Also, if #2 is an expression (i.e. 1+1), the calculation is not performed correctly, since #2 (and #1) is not surrounded by ( and ). (I am not sure if this can happen, or if the parameters are always evaluated beforehand) In my code, I use (to divide #1 by #2): \numexpr((((#1)+((#2)/2))/(#2))-1)\relax This seems to work better. HTH, Jonathan