From unknown Sat Jun 21 03:27:32 2025 X-Loop: don@donarmstrong.com Subject: bug#914: In CVS Emacs, calc-eval gives multiplication higher precidence than division Reply-To: Francis Litterio , 914@debbugs.gnu.org Resent-From: Francis Litterio Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 07 Sep 2008 16:20:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 914 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12208040555577 (code B ref -1); Sun, 07 Sep 2008 16:20: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=-6.2 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 16:14:15 +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 m87GECmx005571 for ; Sun, 7 Sep 2008 09:14:13 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcMtw-0000GK-5S for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2008 12:14:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcMtu-0000Fs-Lg for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2008 12:14:11 -0400 Received: from [199.232.76.173] (port=36414 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcMtu-0000Fp-Cj; Sun, 07 Sep 2008 12:14:10 -0400 Received: from pcls5.std.com ([192.74.137.145]:38089 helo=TheWorld.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KcMtu-0008I6-Hr; Sun, 07 Sep 2008 12:14:10 -0400 Received: from usenlittefl1c.theworld.com (IDENT:105@shell01.theworld.com [192.74.137.71]) by TheWorld.com (8.13.6/8.13.6) with ESMTP id m87GDPMQ030735; Sun, 7 Sep 2008 12:13:29 -0400 From: Francis Litterio To: bug-gnu-emacs@gnu.org, emacs-devel@gnu.org Date: Sun, 07 Sep 2008 12:06:38 -0400 X-Random-Quote: With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion. -- Steven Weinberg Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. In CVS Emacs, function calc-eval (in lisp/calc/calc.el) gives multiplication higher precidence than division. To reproduce, run "emacs -q" and evaluate this form: (progn (require 'calc) (calc-eval "1 / 2 * 1000")) The value of the above form is "5e-4" (as if operator '*' has higher precidence than operator '/'), but it should be "500". -- Fran From unknown Sat Jun 21 03:27:32 2025 X-Loop: don@donarmstrong.com Subject: bug#914: In CVS Emacs, calc-eval gives multiplication higher precidence than division Reply-To: "Lennart Borgman (gmail)" , 914@debbugs.gnu.org Resent-From: "Lennart Borgman (gmail)" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 08 Sep 2008 21:00:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 914 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 914-submit@emacsbugs.donarmstrong.com id=B914.122090724830325 (code B ref 914); Mon, 08 Sep 2008 21:00:04 +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.5 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 914) by emacsbugs.donarmstrong.com; 8 Sep 2008 20:54:08 +0000 Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m88Ks4uN030319 for <914@emacsbugs.donarmstrong.com>; Mon, 8 Sep 2008 13:54:05 -0700 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:64879 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KcnkI-00053v-6j; Mon, 08 Sep 2008 22:54:02 +0200 Message-ID: <48C590E2.4040804@gmail.com> Date: Mon, 08 Sep 2008 22:53:54 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: "Randal L. Schwartz" CC: Carsten Dominik , 914@debbugs.gnu.org, emacs-devel@gnu.org References: <878wu3j4k2.fsf@gmail.com> <86wshn3df0.fsf@blue.stonehenge.com> <7D0B0AA3-AED7-456B-AAAB-D72CABD19CFB@gmail.com> <48C58D7B.1060707@gmail.com> <86k5dmxtaz.fsf@blue.stonehenge.com> In-Reply-To: <86k5dmxtaz.fsf@blue.stonehenge.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080908-0, 2008-09-08), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-ACL-Warn: Too high rate of unknown addresses received from you X-Scan-Result: No virus found in message 1KcnkI-00053v-6j. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1KcnkI-00053v-6j 8487e211f44969c2f645b963fad941d4 Randal L. Schwartz wrote: >>>>>> "Lennart" == Lennart Borgman (gmail) writes: > > Lennart> Of course I can see that the behaviour you want saves you a lot of key > Lennart> strokes. My question is really about the default value. You can easily > Lennart> change that, of course. The question is really if you prefer the old > Lennart> default and in that case what arguments you want to present for that. > > There's no need to change the longstanding defaults, because it would break > things. You already have a knob you can tweak if you think that "2 a / 3 b" > should multiply by b, rather than divide by it. That's a personal choice. I think communication can be very difficult if you have too much personal choice in it. Math is about communication (for a special class of logical problems). The original bug report was about this (calc-eval "1 / 2 * 1000") Calc treats this as 1 / (2 * 1000) which is just plain wrong. I have never seen a mathematician treat it that way - though I have seen many pupils doing that. > Frankly, I'd never touch that knob, because it looks to me like it should > divide by b. And I think most mathemeticians would agree, and that's the > target for that part of Calc. Stop thinking computer science. Think > *math* notation.