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


Message #19 received at 37235 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Charles Karney <charles.karney <at> sri.com>, 37235 <at> debbugs.gnu.org
Subject: Re: bug#37235: 26.1; Precedence error in calc-eval
Date: Fri, 30 Aug 2019 11:26:57 -0400
Mauro Aranda <maurooaranda <at> gmail.com> writes:
>>
>> 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 works as documented in the Calc manual, section 5.15 Formulas:
> C-h i m calc RET 5 m formulas RET
>
> Calc gives '/' lower precedence than '*' by default.

Also see (info "(calc) Basic Arithmetic"),

> To make Calc follow C-like rules, you can set it with the command
> calc-c-language.  You can read its documentation with:
> C-h i m calc RET i calc-c-language

which mentions calc-multiplication-has-precedence.





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.