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


View this message in rfc822 format

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Aitor Soroa <a.soroa <at> ehu.eus>
Cc: 40892 <at> debbugs.gnu.org
Subject: bug#40892: 26.3; emacs calculator.el: return values are truncated integers
Date: Mon, 27 Apr 2020 10:14:09 +0200
On Apr 27 2020, Aitor Soroa wrote:

> The calculator.el: wrongly returns integers. For instance:
>
> emacs -Q
> M-x calculator
> 22 / 7
>
> The answer is '3'. Even worse, If I set calculator-remove-zeros to nil,
> then I get '3.000'

This is consistent with how Emacs Lisp works:

ELISP> (/ 22 7)
3 (#o3, #x3, ?\C-c)
ELISP> (/ 22 7.0)
3.142857142857143

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




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

Previous Next


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