From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jay Belanger Newsgroups: gmane.emacs.devel Subject: Re: Calc: `*' binds more strongly than `/' Date: Wed, 25 Apr 2007 15:54:36 -0500 Message-ID: <87d51sqinn.fsf@gmail.com> References: <87y7kvxj6p.fsf@arcor.de> <87odlrkn74.fsf@truman.edu> <87tzvhcul9.fsf@stupidchicken.com> <863b2z2mma.fsf@blue.stonehenge.com> <55350.128.165.123.18.1176926533.squirrel@webmail.lanl.gov> <86ps5zuwmi.fsf@blue.stonehenge.com> <87ps5zi1h2.fsf@truman.edu> <462C8EA2.9090003@gnu.org> <87ejmbdr1x.fsf@truman.edu> Reply-To: jay.p.belanger@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177534678 32452 80.91.229.12 (25 Apr 2007 20:57:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 Apr 2007 20:57:58 +0000 (UTC) Cc: jay.p.belanger@gmail.com To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 25 22:57:50 2007 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 1HgoYg-0008F4-9x for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2007 22:57:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HgoeK-0003X0-SI for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2007 17:03:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HgobZ-0002X4-3G for emacs-devel@gnu.org; Wed, 25 Apr 2007 17:00:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HgobM-0002Wo-J6 for emacs-devel@gnu.org; Wed, 25 Apr 2007 17:00:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HgobM-0002Wl-Ce for emacs-devel@gnu.org; Wed, 25 Apr 2007 17:00:36 -0400 Original-Received: from uranium.truman.edu ([150.243.160.94]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HgoVg-0007pj-Ra for emacs-devel@gnu.org; Wed, 25 Apr 2007 16:54:45 -0400 Original-Received: from uranium.truman.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 1A9C85FFE5; Wed, 25 Apr 2007 15:54:43 -0500 (CDT) Original-Received: from localhost.localdomain (unknown [150.243.64.25]) by uranium.truman.edu (Postfix) with ESMTP id 005F35FF70; Wed, 25 Apr 2007 15:54:41 -0500 (CDT) In-Reply-To: (Christian Schlauer's message of "Wed\, 25 Apr 2007 21\:56\:51 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Wed, 25 Apr 2007 17:03:38 -0400 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:70133 Archived-At: Christian Schlauer writes: > Jay Belanger writes: ... >> Well, I think that's the proper way of doing it; even though there are >> rules for interpreting expressions like a*b/c*d, that doesn't mean >> writing the expression that way is a good thing to do -- it's just bad >> form. I don't think there is any difference between Calc's current >> precedence rule and the more standard one for properly written >> expressions. > > I did some more `research', and a*b/c*d is not bad form, and it is a > properly written expression, see Wikipedia. Let me cite from > : As I said, there are rules for interpreting the above expressions. I also said that avoiding the parentheses is bad form; note that the wikipedia article also says: Proper use of parentheses and other grouping symbols When restricted to using a straight text editor, parentheses (or more generally "grouping symbols") must be used generously to make up for the lack of graphics, like square root symbols. Here are some rules for doing so: 1) Whenever there is a fraction formed with a slash, put the numerator (the number on top of the fraction) in one set of parentheses, and the denominator (the number on the bottom of the fraction) in another set of parentheses. This is not required for fractions formed with underlines: y = (x+1)/(x+2) ... 5) An exception to the rules requiring parentheses applies when only one character is present. While correct either way, it is more readable if parentheses around a single character are omitted: y = (3)/(x) or y = 3/x y = (3)/(2x) or y = 3/(2x) > So besides Excel, Gnumeric, MATLAB, all pocket calculators, Wikipedia > agrees with me, too. Well, wikipedia also says Calculators Different calculators follow different orders of operations. and gives several examples. The reason for Calc's current behavior is because Dave Gillespie, Calc's author, thought of "a b / c d" as representing a b --- c d To have it represent "a(b/c)d", the parentheses can (and, according to wikipedia, should be) put in. For those that really don't like parentheses, an option to allow the user to decide for themselves the relative precedence of * and / in Calc will be added, of course. Jay