From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: In CVS Emacs, calc-eval gives multiplication higher precidence than division Date: Mon, 08 Sep 2008 09:26:59 +0200 Message-ID: <48C4D3C3.60306@gmail.com> References: <878wu3j4k2.fsf@gmail.com> <86wshn3df0.fsf@blue.stonehenge.com> <48C43ADA.1070001@gmail.com> <86sksb3d53.fsf@blue.stonehenge.com> <48C43CB7.4060505@gmail.com> <86y7231ltv.fsf@blue.stonehenge.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1220858845 12288 80.91.229.12 (8 Sep 2008 07:27:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Sep 2008 07:27:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Randal L. Schwartz" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 08 09:28:20 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 1KcbAY-0005Tr-1j for ged-emacs-devel@m.gmane.org; Mon, 08 Sep 2008 09:28:18 +0200 Original-Received: from localhost ([127.0.0.1]:50440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kcb9X-00052F-KO for ged-emacs-devel@m.gmane.org; Mon, 08 Sep 2008 03:27:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kcb9S-00051V-JT for emacs-devel@gnu.org; Mon, 08 Sep 2008 03:27:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kcb9Q-000503-Hs for emacs-devel@gnu.org; Mon, 08 Sep 2008 03:27:09 -0400 Original-Received: from [199.232.76.173] (port=47489 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kcb9Q-000500-BD for emacs-devel@gnu.org; Mon, 08 Sep 2008 03:27:08 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:43275) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kcb9P-0004dn-QT for emacs-devel@gnu.org; Mon, 08 Sep 2008 03:27:08 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kcb9O-00072t-TA for emacs-devel@gnu.org; Mon, 08 Sep 2008 03:27:07 -0400 Original-Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:61053 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Kcb9N-0000O2-4B; Mon, 08 Sep 2008 09:27:05 +0200 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 In-Reply-To: <86y7231ltv.fsf@blue.stonehenge.com> X-Enigmail-Version: 0.95.7 X-Antivirus: avast! (VPS 080907-0, 2008-09-07), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1Kcb9N-0000O2-4B. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1Kcb9N-0000O2-4B 67c2f65cb9b8791f8bdcff8a4809c96d X-detected-kernel: by mx20.gnu.org: Linux 2.6? (barebone, rare!) 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:103672 Archived-At: Randal L. Schwartz wrote: > 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. I am afraid I think you misunderstand this issue. We are talking about a * b / c * d But thanks, maybe I can understand a bit better why some people believe that these precedence rules exists now. Indeed, as you pointed out "2b" is often interpreted as "2 * b" and that might give the impression that there is a precedence rule for * and / that says * has higher precedence. But there is no such rule. It is about different notations instead. You have to be more careful when translating notations. The notation translation is rather 2b / 5d => (2 * b) / (5 * d)