From: "Mattias Engdegård" <mattiase@acm.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 43902@debbugs.gnu.org, Jay Belanger <jay.p.belanger@gmail.com>
Subject: bug#43902: 28.0.50; Calc: Wrong eval precedence rules with LaTeX language
Date: Sat, 10 Oct 2020 12:03:25 +0200 [thread overview]
Message-ID: <DFEE4745-665F-47D4-B37D-C0BEFB164A6E@acm.org> (raw)
In-Reply-To: <871ri6y35h.fsf@web.de>
Michael Heerdegen dixit:
> M-x calc RET
> d L ;; calc-latex-language
> ' ;; calc-algebraic-entry
> 1+1/2 RET
>
> The result is 1, and the Trail shows alg' (1 + 1) / 2. It does not make
> much sense to me to use a precedence rule where addition has higher
> precedence than division. I know LaTeX a bit and don't expect such a
> result, and it doesn't seem to be documented. Is it intended or a bug?
Indeed, $a+b/c$ is typeset by (La)TeX as (approx.) a + b/c which can only mean one thing, but Calc incorrectly parses it as (a+b)/c. This seems to be the consequence of an explicit change:
commit fda9b316f84dbc6d68e6cb74b386ee4b92d81b31
Author: Jay Belanger <jay.p.belanger@gmail.com>
Date: Fri Nov 16 04:15:23 2007 +0000
(math-oper-table): Fix typo. Reduce precedence of "/" for TeX.
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
- ( "/" / 185 186 )
+ ( "/" / 170 171 )
Jay, do you remember the reason for this change?
next prev parent reply other threads:[~2020-10-10 10:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-10 7:02 bug#43902: 28.0.50; Calc: Wrong eval precedence rules with LaTeX language Michael Heerdegen
2020-10-10 10:03 ` Mattias Engdegård [this message]
2020-10-13 9:40 ` Mattias Engdegård
2020-10-13 16:22 ` Eli Zaretskii
2020-10-13 18:03 ` Mattias Engdegård
2020-10-13 18:22 ` Eli Zaretskii
2020-10-14 7:26 ` Mattias Engdegård
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=DFEE4745-665F-47D4-B37D-C0BEFB164A6E@acm.org \
--to=mattiase@acm.org \
--cc=43902@debbugs.gnu.org \
--cc=jay.p.belanger@gmail.com \
--cc=michael_heerdegen@web.de \
/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).