GNU bug report logs - #914
In CVS Emacs, calc-eval gives multiplication higher precedence than division

Previous Next

Package: emacs;

Reported by: Francis Litterio <flitterio <at> gmail.com>

Date: Sun, 7 Sep 2008 16:20:03 UTC

Severity: normal

Merged with 915, 918, 920, 921, 923, 924, 928, 929, 930, 932, 933, 934, 937, 941, 944

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 914 in the body.
You can then email your comments to 914 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#914; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Francis Litterio <flitterio <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Francis Litterio <flitterio <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org, emacs-devel <at> gnu.org
Subject: In CVS Emacs, calc-eval gives multiplication higher precidence than division
Date: Sun, 07 Sep 2008 12:06:38 -0400
In CVS Emacs, function calc-eval (in lisp/calc/calc.el) gives
multiplication higher precidence than division.  To reproduce, run
"emacs -q" and evaluate this form:

   (progn
     (require 'calc)
     (calc-eval "1 / 2 * 1000"))

The value of the above form is "5e-4" (as if operator '*' has higher
precidence than operator '/'), but it should be "500".
--
Fran





bug closed, send any further explanations to Francis Litterio <flitterio <at> gmail.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Sun, 07 Sep 2008 19:00:06 GMT) Full text and rfc822 format available.

Forcibly Merged 914 915 918 920 921 923 924. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Mon, 08 Sep 2008 02:25:06 GMT) Full text and rfc822 format available.

Forcibly Merged 914 915 918 920 921 923 924 928 929 930. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Mon, 08 Sep 2008 20:35:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#914; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #16 received at 914 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
To: "Randal L. Schwartz" <merlyn <at> stonehenge.com>
Cc: Carsten Dominik <carsten.dominik <at> gmail.com>,
        914 <at> debbugs.gnu.org, emacs-devel <at> gnu.org
Subject: Re: In CVS Emacs, calc-eval gives multiplication higher  precidence
  than division
Date: Mon, 08 Sep 2008 22:53:54 +0200
Randal L. Schwartz wrote:
>>>>>> "Lennart" == Lennart Borgman (gmail) <lennart.borgman <at> gmail.com> writes:
> 
> Lennart> Of course I can see that the behaviour you want saves you a lot of key
> Lennart> strokes. My question is really about the default value. You can easily
> Lennart> change that, of course. The question is really if you prefer the old
> Lennart> default and in that case what arguments you want to present for that.
> 
> There's no need to change the longstanding defaults, because it would break
> things.  You already have a knob you can tweak if you think that "2 a / 3 b"
> should multiply by b, rather than divide by it.  That's a personal choice.

I think communication can be very difficult if you have too much
personal choice in it. Math is about communication (for a special class
of logical problems).

The original bug report was about this

  (calc-eval "1 / 2 * 1000")

Calc treats this as 1 / (2 * 1000) which is just plain wrong. I have
never seen a mathematician treat it that way - though I have seen many
pupils doing that.


> Frankly, I'd never touch that knob, because it looks to me like it should
> divide by b.  And I think most mathemeticians would agree, and that's the
> target for that part of Calc.  Stop thinking computer science.  Think
> *math* notation.





Forcibly Merged 914 915 918 920 921 923 924 928 929 930 932 933. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Mon, 08 Sep 2008 21:00:06 GMT) Full text and rfc822 format available.

Forcibly Merged 914 915 918 920 921 923 924 928 929 930 932 933 934. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Mon, 08 Sep 2008 21:00:09 GMT) Full text and rfc822 format available.

Forcibly Merged 914 915 918 920 921 923 924 928 929 930 932 933 934 937. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Mon, 08 Sep 2008 22:30:03 GMT) Full text and rfc822 format available.

Changed bug title to `In CVS Emacs, calc-eval gives multiplication higher precedence than division' from `In CVS Emacs, calc-eval gives multiplication higher precidence than division'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Mon, 08 Sep 2008 22:30:05 GMT) Full text and rfc822 format available.

Forcibly Merged 914 915 918 920 921 923 924 928 929 930 932 933 934 937 941 944. Request was from "Juanma Barranquero" <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Tue, 09 Sep 2008 14:50:07 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Wed, 08 Oct 2008 14:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.