From: Luc Teirlinck <teirllm@dms.auburn.edu>
To: monnier@iro.umontreal.ca
Cc: jay.p.belanger@gmail.com, emacs-devel@gnu.org
Subject: Re: Calc: `*' binds more strongly than `/'
Date: Thu, 26 Apr 2007 13:32:36 -0500 (CDT) [thread overview]
Message-ID: <200704261832.l3QIWajF026730@jane.dms.auburn.edu> (raw)
In-Reply-To: <jwv647j15xd.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Thu, 26 Apr 2007 12:01:46 -0400)
Stefan Monnier wrote:
> For what it's worth, Mathematica (one of the few other programs with the
> "implicit multiplication" operator) gives implicit and explicit
> multiplication and division equal precedence: a b/c d puts d in the
> numerator, as does a*b/c*d.
Hmm... that does come as unintuitive to me.
No. Because b/c can be interpreted as an individual rational number,
rather than the result of an operation (division). This is especially
true when you are using software that implements rational numbers.
This is actually one of the main reasons that / usually has precedence
over *: a*b/c*d can be considered as `a' times the rational number
`b/c' times `d'; / can also be considered as an operation and a,b,c,d
as four distinct numbers. If you give / higher precedence as *, you
do not have to worry about which interpretation is "correct", since it
does not make any difference.
2/3 * 5/7 = 10/21, in either interpretation _assuming_ / has higher
precedence than *.
Of course, provoking discussions like this is one of the many reasons
why the Devil invented infix notation. If you have to use it, then
the best way to defeat his brilliant but evil scheme is to always
write explicitly (a*b)/(b*c) or a*(b/c)*d, to leave no doubt whatsoever.
Sincerely,
Luc.
next prev parent reply other threads:[~2007-04-26 18:32 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-14 11:57 Calc: `*' binds more strongly than `/' Christian Schlauer
2007-04-14 15:09 ` Jay Belanger
2007-04-15 19:21 ` Chong Yidong
2007-04-15 20:05 ` Stefan Monnier
2007-04-17 12:47 ` Randal L. Schwartz
2007-04-17 18:03 ` Stefan Monnier
2007-04-18 8:44 ` Kim F. Storm
2007-04-18 19:27 ` Stefan Monnier
2007-04-18 20:02 ` Davis Herring
2007-04-18 20:16 ` David Kastrup
2007-04-18 21:43 ` Davis Herring
2007-04-19 16:10 ` Stefan Monnier
2007-04-20 11:13 ` Randal L. Schwartz
2007-04-20 13:40 ` Stefan Monnier
2007-04-20 14:07 ` Jay Belanger
2007-04-22 1:31 ` Miles Bader
2007-04-22 10:19 ` Christian Schlauer
2007-04-22 10:23 ` Christian Schlauer
2007-04-22 19:47 ` Jay Belanger
2007-04-23 10:46 ` Jason Rumney
2007-04-23 13:03 ` Kim F. Storm
2007-04-23 15:54 ` Jay Belanger
2007-04-25 19:56 ` Christian Schlauer
2007-04-25 20:54 ` Jay Belanger
2007-04-26 3:35 ` Stefan Monnier
2007-04-26 4:06 ` Jay Belanger
2007-04-26 14:11 ` Stefan Monnier
2007-04-26 21:07 ` Christian Schlauer
2007-04-26 15:07 ` Davis Herring
2007-04-26 16:01 ` Stefan Monnier
2007-04-26 18:32 ` Luc Teirlinck [this message]
2007-04-26 21:29 ` Christian Schlauer
2007-04-26 23:17 ` Luc Teirlinck
2007-04-26 21:07 ` Christian Schlauer
2007-04-27 1:27 ` Jay Belanger
2007-04-26 17:47 ` Davis Herring
2007-06-20 15:23 ` Jay Belanger
2007-06-20 16:02 ` Kim F. Storm
2007-06-20 17:13 ` Jay Belanger
2007-06-20 17:29 ` Luc Teirlinck
2007-06-20 17:54 ` Jay Belanger
2007-06-20 19:14 ` Kim F. Storm
2007-06-20 19:28 ` Luc Teirlinck
2007-06-20 20:18 ` Jay Belanger
2007-04-17 18:54 ` Jay Belanger
2007-04-18 21:55 ` Christian Schlauer
2007-04-19 2:58 ` Daniel Brockman
2007-04-22 10:27 ` Christian Schlauer
2007-04-26 16:00 ` Daniel Brockman
2007-04-19 15:16 ` Drew Adams
2007-04-19 17:05 ` David Kastrup
2007-04-19 17:18 ` Drew Adams
2007-04-19 17:33 ` David Kastrup
2007-04-16 15:38 ` Richard Stallman
2007-04-17 12:47 ` Randal L. Schwartz
2007-04-18 21:29 ` Christian Schlauer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200704261832.l3QIWajF026730@jane.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--cc=emacs-devel@gnu.org \
--cc=jay.p.belanger@gmail.com \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.