bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40892: 26.3; emacs calculator.el: return values are truncated intege


From: Noam Postavsky
Subject: bug#40892: 26.3; emacs calculator.el: return values are truncated integers
Date: Wed, 29 Apr 2020 11:57:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)

>>> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]