all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Charles Karney <charles.karney@sri.com>
Cc: 37235@debbugs.gnu.org
Subject: bug#37235: 26.1; Precedence error in calc-eval
Date: Fri, 30 Aug 2019 12:04:35 -0300	[thread overview]
Message-ID: <CABczVwcqb3WMmXTRGOu+qjTmnFBhs=3=EK+dL6ajpbicoHLB-g@mail.gmail.com> (raw)
In-Reply-To: <857abb8d-8da0-82b2-d50d-01d57b4be681@sri.com>

[-- Attachment #1: Type: text/plain, Size: 936 bytes --]

tags 37235 notabug
quit

Charles Karney via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> In GNU Emacs 26.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.23.2)
>   of 2018-08-13 built on buildvm-13.phx2.fedoraproject.org
> Windowing system distributor 'Fedora Project', version 11.0.12004000
> System Description: Fedora release 29 (Twenty Nine)
>
> 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.

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


Best regards,
Mauro.

[-- Attachment #2: Type: text/html, Size: 1275 bytes --]

  reply	other threads:[~2019-08-30 15:04 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 [this message]
2019-08-30 15:26   ` Noam Postavsky
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='CABczVwcqb3WMmXTRGOu+qjTmnFBhs=3=EK+dL6ajpbicoHLB-g@mail.gmail.com' \
    --to=maurooaranda@gmail.com \
    --cc=37235@debbugs.gnu.org \
    --cc=charles.karney@sri.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.