From unknown Fri Aug 15 16:55:41 2025 X-Loop: don@donarmstrong.com Subject: bug#921: In CVS Emacs, calc-eval gives multiplication higher precidence than division Reply-To: jay.p.belanger@gmail.com, 921@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 20:45:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 921 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.1220819760704 (code B ref -1); Sun, 07 Sep 2008 20: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.6 required=4.0 tests=AWL,BAYES_00, 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 20:36:00 +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 m87KZusN000698 for ; Sun, 7 Sep 2008 13:35:57 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcQzE-00045c-99 for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2008 16:35:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcQzC-00044u-Lz for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2008 16:35:55 -0400 Received: from [199.232.76.173] (port=42571 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcQzC-00044q-E5; Sun, 07 Sep 2008 16:35:54 -0400 Received: from s1.cableone.net ([24.116.0.227]:46730) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KcQzB-0002p9-CN; Sun, 07 Sep 2008 16:35:54 -0400 Received: from belanger (unverified [69.92.109.217]) by s1.cableone.net (CableOne SMTP Service s1) with ESMTP id 5352024-1872270 for multiple; Sun, 07 Sep 2008 13:35:39 -0700 From: Jay Belanger To: Stefan Monnier Cc: Francis Litterio , bug-gnu-emacs@gnu.org, emacs-devel@gnu.org References: <878wu3j4k2.fsf@gmail.com> CC: jay.p.belanger@gmail.com Date: Sun, 07 Sep 2008 15:35:37 -0500 In-Reply-To: (Stefan Monnier's message of "Sun, 07 Sep 2008 15:46:52 -0400") Message-ID: <873akbitie.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 67, in=24, 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) >> That's not a bug. While many systems give division a higher precendence >> than multiplication, that isn't a universal rule. > > Actually, I don't know of any system that gives higher precedence to > division. According to Wikipedia: An expression like 1/2x is interpreted as 1/(2x) by TI-82, but as (1/2)x by TI-83. While the first interpretation may be expected by some users, only the latter is in agreement with the standard rules stated above. > The general rule that (AFAIK) all programming languages > follow (other than those that don't use infix-with-precedence, such as > Lisp and Smalltalk) is that * and / have the same precedence (and are > left associative). That behavior is available, but you have to ask for it by setting `calc-multiplication-has-precedence' to nil.