all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Mauro Aranda <maurooaranda@gmail.com>
Cc: Charles Karney <charles.karney@sri.com>, 37235@debbugs.gnu.org
Subject: bug#37235: 26.1; Precedence error in calc-eval
Date: Fri, 30 Aug 2019 11:26:57 -0400	[thread overview]
Message-ID: <85r252ishq.fsf@gmail.com> (raw)
In-Reply-To: <CABczVwcqb3WMmXTRGOu+qjTmnFBhs=3=EK+dL6ajpbicoHLB-g@mail.gmail.com> (Mauro Aranda's message of "Fri, 30 Aug 2019 12:04:35 -0300")

Mauro Aranda <maurooaranda@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.






  reply	other threads:[~2019-08-30 15:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 13:41 bug#37235: 26.1; Precedence error in calc-eval Charles Karney via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-08-30 15:04 ` Mauro Aranda
2019-08-30 15:26   ` Noam Postavsky [this message]
2019-09-16  3:06   ` Stefan Kangas
2019-08-30 15:07 ` Andreas Schwab

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85r252ishq.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=37235@debbugs.gnu.org \
    --cc=charles.karney@sri.com \
    --cc=maurooaranda@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.