unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: emacs-devel@gnu.org
Subject: Re: In CVS Emacs, calc-eval gives multiplication higher  precidence than division
Date: Sun, 07 Sep 2008 18:13:32 -0700	[thread overview]
Message-ID: <86y7231ltv.fsf@blue.stonehenge.com> (raw)
In-Reply-To: 48C43CB7.4060505@gmail.com

>>>>> "Lennart" == Lennart Borgman (gmail) <lennart.borgman@gmail.com> 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
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion





  parent reply	other threads:[~2008-09-08  1:13 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-07 16:06 In CVS Emacs, calc-eval gives multiplication higher precidence than division Francis Litterio
2008-09-07 16:37 ` Jay Belanger
2008-09-07 18:15   ` Francis Litterio
2008-09-07 19:46   ` Stefan Monnier
2008-09-07 20:19     ` bug#920: " Lennart Borgman (gmail)
2008-09-07 20:32     ` Randal L. Schwartz
2008-09-07 20:34       ` Lennart Borgman (gmail)
2008-09-07 20:38         ` Randal L. Schwartz
2008-09-07 20:42           ` Lennart Borgman (gmail)
2008-09-07 20:50             ` Randal L. Schwartz
2008-09-07 21:07               ` Lennart Borgman (gmail)
2008-09-08  6:39                 ` Ulrich Mueller
2008-09-08  7:07                   ` Lennart Borgman (gmail)
2008-09-07 21:10               ` Stefan Monnier
2008-09-07 23:30                 ` Jay Belanger
2008-09-08  0:50               ` Jason Rumney
2008-09-08  1:13             ` Randal L. Schwartz [this message]
2008-09-08  3:47               ` Stefan Monnier
2008-09-08  8:48                 ` Miles Bader
2008-09-08 12:59                   ` Stefan Monnier
2008-09-08 13:29                   ` martin rudalics
2008-09-08  7:26               ` Lennart Borgman (gmail)
2008-09-07 21:10           ` Stefan Monnier
2008-09-08 10:30       ` Carsten Dominik
2008-09-08 11:01         ` Lennart Borgman
2008-09-08 20:33           ` Carsten Dominik
2008-09-08 20:39             ` Lennart Borgman (gmail)
2008-09-08 20:43               ` Randal L. Schwartz
2008-09-08 20:53                 ` Lennart Borgman (gmail)
2008-09-08 22:59                   ` bug#914: " Jay Belanger
2008-09-08 23:44                     ` Lennart Borgman (gmail)
2008-09-09 13:28                     ` Stefan Monnier
2008-09-09 14:36                       ` Francis Litterio
2008-09-09 16:26                         ` Ulrich Mueller
2008-09-09 16:41                           ` Lennart Borgman (gmail)
2008-09-30  4:10                         ` Leo
2008-09-08 21:42                 ` Stefan Monnier
2008-09-09  8:11                 ` Richard M. Stallman
2008-09-09 13:26                   ` Stefan Monnier
2008-09-09 17:03                     ` Lennart Borgman (gmail)
2008-09-09 17:19                       ` Stefan Monnier
2008-09-08 13:01         ` Stefan Monnier
2008-09-07 20:35     ` Jay Belanger
2008-09-07 21:15       ` Stefan Monnier
2008-09-07 21:19         ` Lennart Borgman (gmail)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y7231ltv.fsf@blue.stonehenge.com \
    --to=merlyn@stonehenge.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).