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

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

bug#31938: followup


From: Paul Eggert
Subject: bug#31938: followup
Date: Mon, 25 Jun 2018 12:38:02 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/23/2018 04:46 AM, Eli Zaretskii wrote:
From: Paul Pogonyshev <address@hidden>
Date: Sat, 23 Jun 2018 12:21:00 +0200

Another difference. In Emacs 24-26:

     (format "%d" 0.9) => "0"

In Emacs 27:

     (format "%d" 0.9) => "1"
This looks like the (unintended?) result of 80e145fc9.

I vaguely recall relying on the Elisp manual, which says that %d must be applied only to integers, and I guess I figured the semantics didn't matter so that the simplest implementation (thought that rounding and keeping -0) would satisfy the doc and anyway would be more helpful than truncating and discarding the sign of -0. But now that I reread the manual I see that it says %d must signal an error when given a float, which is obviously not the behavior, so the manual is wrong. And now that this issue has come up I notice that 80e145fc9 caused %d to behave inconsistently with %x; the latter truncates and converts -0 to 0 whereas the former rounds and keeps -0. This inconsistency is not good.

To try to improve this, I installed the attached into master to change 'format' to be more compatible with Emacs 26 etc. and am boldly closing the bug report.

Attachment: 0001-format-d-F-now-truncates-floating-F.patch
Description: Text Data


reply via email to

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