From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: merlyn@stonehenge.com (Randal L. Schwartz) Newsgroups: gmane.emacs.devel Subject: Re: In CVS Emacs, calc-eval gives multiplication higher precidence than division Date: Sun, 07 Sep 2008 18:13:32 -0700 Organization: Stonehenge Consulting Services; Portland, Oregon, USA Message-ID: <86y7231ltv.fsf@blue.stonehenge.com> References: <878wu3j4k2.fsf@gmail.com> <86wshn3df0.fsf@blue.stonehenge.com> <48C43ADA.1070001@gmail.com> <86sksb3d53.fsf@blue.stonehenge.com> <48C43CB7.4060505@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220836475 30184 80.91.229.12 (8 Sep 2008 01:14:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Sep 2008 01:14:35 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 08 03:15:31 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KcVLk-000802-C7 for ged-emacs-devel@m.gmane.org; Mon, 08 Sep 2008 03:15:28 +0200 Original-Received: from localhost ([127.0.0.1]:48394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcVKk-0000Zv-Dq for ged-emacs-devel@m.gmane.org; Sun, 07 Sep 2008 21:14:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcVK8-0000RQ-6M for emacs-devel@gnu.org; Sun, 07 Sep 2008 21:13:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcVK7-0000R3-Cm for emacs-devel@gnu.org; Sun, 07 Sep 2008 21:13:47 -0400 Original-Received: from [199.232.76.173] (port=56786 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcVK7-0000Qy-4x for emacs-devel@gnu.org; Sun, 07 Sep 2008 21:13:47 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:42469 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KcVK6-00029C-Pb for emacs-devel@gnu.org; Sun, 07 Sep 2008 21:13:47 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KcVK3-0003rO-Mk for emacs-devel@gnu.org; Mon, 08 Sep 2008 01:13:43 +0000 Original-Received: from blue.stonehenge.com ([209.223.236.162]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Sep 2008 01:13:43 +0000 Original-Received: from merlyn by blue.stonehenge.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Sep 2008 01:13:43 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: blue.stonehenge.com x-mayan-date: Long count = 12.19.15.11.14; tzolkin = 11 Ix; haab = 17 Mol User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (berkeley-unix) Cancel-Lock: sha1:sGpkGGWlLwuzd9AFH2LQ6rFYKw0= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:103664 Archived-At: >>>>> "Lennart" == Lennart Borgman (gmail) writes: Lennart> More seriously: Where do you get those rules from? The notation Lennart> a b / c d Lennart> does not look like a standard math notation. If a is 2, and c is 5, you're actually telling me that *you* would parse: 2 b / 5 d as ((2 * b) / 5) * d ? That's crazy. That's (2b)/(5d), according to any math teacher I knew from school. That's the only sane parsing of that. Now, replace 2 with "a" and 5 with "c", and you get: ab/cd which is (ab)/(cd). That's what I mean. This is the *mathematical* evaluation. In this case, division *is* lower precedence than multiplication. Anyway, maybe you've never seen expressions like 2a/5d before. I dealt with them in my algebra class, but perhaps that was before you were born, and before computers came into usage in high schools. I suppose the rules changed once we started teaching * and / as same precedence in computer science, which then leaked over into math notation as well. I'm probably not going to convince you of anything here, but I did want to come up with a better example, now that I'm going through the calc manual again. And then, it made perfect sense, as it still does. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion