GNU bug report logs - #37235
26.1; Precedence error in calc-eval

Previous Next

Package: emacs;

Reported by: Charles Karney <charles <at> karney.com>

Date: Fri, 30 Aug 2019 14:44:02 UTC

Severity: normal

Tags: notabug

Found in version 26.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: 37235 <at> debbugs.gnu.org
Cc: charles.karney <at> sri.com
Subject: bug#37235: 26.1; Precedence error in calc-eval
Date: Fri, 30 Aug 2019 17:07:08 +0200
On Aug 30 2019, Charles Karney via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> wrote:

> The precedence of calc-eval doesn't follow C-like rules.
>
>    (calc-eval "1/2*3") returns "0.166666666667"
>
> returning the same answer as (calc-eval "1/2/3").  It should return
> "1.5".

It is documented that multiplication has higher precedence than
devision (see (calc) Formulas).  Calc is following the rules of
Algebra.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




This bug report was last modified 5 years and 252 days ago.

Previous Next


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