From unknown Sun Jun 22 08:01:37 2025 X-Loop: don@donarmstrong.com Subject: bug#915: In CVS Emacs, calc-eval gives multiplication higher precidence than division Reply-To: jay.p.belanger@gmail.com, 915@debbugs.gnu.org Resent-From: Jay Belanger Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 07 Sep 2008 16:45:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 915 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122080543613810 (code B ref -1); Sun, 07 Sep 2008 16:45:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.7 required=4.0 tests=AWL,BAYES_00,GMAIL, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 7 Sep 2008 16:37:16 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m87GbCYZ013804 for ; Sun, 7 Sep 2008 09:37:13 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcNGC-0005NA-7N for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2008 12:37:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcNG9-0005M1-VU for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2008 12:37:11 -0400 Received: from [199.232.76.173] (port=37229 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcNG9-0005Ly-PM; Sun, 07 Sep 2008 12:37:09 -0400 Received: from s3.cableone.net ([24.116.0.229]:42656) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KcNG9-0003Hr-Mz; Sun, 07 Sep 2008 12:37:09 -0400 Received: from belanger (unverified [69.92.109.217]) by S3.cableone.net (CableOne SMTP Service S3) with ESMTP id 5483229-1872270 for multiple; Sun, 07 Sep 2008 09:37:03 -0700 From: Jay Belanger To: Francis Litterio Cc: bug-gnu-emacs@gnu.org, emacs-devel@gnu.org References: CC: jay.p.belanger@gmail.com Date: Sun, 07 Sep 2008 11:37:01 -0500 In-Reply-To: (Francis Litterio's message of "Sun, 07 Sep 2008 12:06:38 -0400") Message-ID: <878wu3j4k2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Vpipe: Scanner said ok (av_avast) X-NotAscii: charset=us-ascii X-IP-stats: Incoming Last 2, First 65, in=22, out=0, spam=0 ip=69.92.109.217 X-Originating-IP: 69.92.109.217 X-Abuse-Info: Send abuse complaints to abuse@cableone.net X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Francis Litterio writes: ... > In CVS Emacs, function calc-eval (in lisp/calc/calc.el) gives > multiplication higher precidence than division. That's not a bug. While many systems give division a higher precendence than multiplication, that isn't a universal rule. Calc has always given multiplication a higher precendence, and something like 1 / 2 * 1000 can be viewed as shorthand for 1 -------- 2 * 1000 Some people don't like this, some people do, but this choice is established Calc behavior and is highlighted in the manual. To divide first, it's probably better style regardless to put in the parentheses: (1 / 2) * 1000 Jay