GNU bug report logs - #40892
26.3; emacs calculator.el: return values are truncated integers

Previous Next

Package: emacs;

Reported by: Aitor Soroa <a.soroa <at> ehu.eus>

Date: Mon, 27 Apr 2020 07:14:01 UTC

Severity: minor

Tags: confirmed

Found in versions 26.3, 26.1

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Tomas Nordin <tomasn <at> posteo.net>
Cc: 40892 <at> debbugs.gnu.org, Aitor Soroa <a.soroa <at> ehu.eus>,
 Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#40892: 26.3;
 emacs calculator.el: return values are truncated integers
Date: Wed, 29 Apr 2020 11:57:23 -0400
>>> 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.





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

Previous Next


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