all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Tomas Nordin <tomasn@posteo.net>
Cc: 40892@debbugs.gnu.org, Aitor Soroa <a.soroa@ehu.eus>,
	Andreas Schwab <schwab@linux-m68k.org>
Subject: bug#40892: 26.3; emacs calculator.el: return values are truncated integers
Date: Wed, 29 Apr 2020 11:57:23 -0400	[thread overview]
Message-ID: <85v9ligu8s.fsf@gmail.com> (raw)
In-Reply-To: <871ro9b8cz.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> (Tomas Nordin's message of "Mon, 27 Apr 2020 11:12:12 +0200")

>>> M-x calculator
>>> 22 / 7
>>>
>>> The answer is '3'.

>> ELISP> (/ 22 7)
>> 3 (#o3, #x3, ?\C-c)
>> ELISP> (/ 22 7.0)
>> 3.142857142857143
>
> It might be a bit surprising through an interface that is meant to be
> similar to popular calc apps (if meant so). On the other hand maybe one
> wants to do integer divisions as well. This report could be a suggestion
> of a new variable like 'treat-input-integers-as-floats'.

There is already an integer division operation:

    22.0 / 7 RET ===> 3.143

    22.0 \ 7 RET ===> 3

But we probably do still want an option, just because existing users may
want to keep the current behaviour.






  reply	other threads:[~2020-04-29 15:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  7:12 bug#40892: 26.3; emacs calculator.el: return values are truncated integers Aitor Soroa
2020-04-27  8:14 ` Andreas Schwab
2020-04-27  9:12   ` Tomas Nordin
2020-04-29 15:57     ` Noam Postavsky [this message]
2020-04-30 12:53 ` Mattias Engdegård
2020-04-30 12:59   ` Noam Postavsky
2020-04-30 13:15     ` Mattias Engdegård
2020-04-30 14:05       ` Eli Zaretskii
2020-04-30 17:08       ` Eli Barzilay

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=85v9ligu8s.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=40892@debbugs.gnu.org \
    --cc=a.soroa@ehu.eus \
    --cc=schwab@linux-m68k.org \
    --cc=tomasn@posteo.net \
    /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.