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

Previous Next

Package: emacs;

Reported by: jay.p.belanger <at> gmail.com

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

Severity: normal

Merged with 914, 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.

Full log


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

From: Jay Belanger <jay.p.belanger <at> gmail.com>
To: Francis Litterio <flitterio <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org, emacs-devel <at> gnu.org
Subject: Re: In CVS Emacs, calc-eval gives multiplication higher precidence than division
Date: Sun, 07 Sep 2008 11:37:01 -0500
Francis Litterio <flitterio <at> gmail.com> writes:
...
> In CVS Emacs, function calc-eval (in lisp/calc/calc.el) gives
> multiplication higher precidence than division.

That's not a bug.  While many systems give division a higher precendence
than multiplication, that isn't a universal rule.  Calc has always given
multiplication a higher precendence, and something like
1 / 2 * 1000
can be viewed as shorthand for
   1
--------
2 * 1000
Some people don't like this, some people do, but this choice is
established Calc behavior and is highlighted in the manual.  To divide
first, it's probably better style regardless to put in the parentheses:
(1 / 2) * 1000

Jay





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

Previous Next


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