aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPaul Eggert2018-03-08 20:55:55 -0800
committerPaul Eggert2018-03-08 20:57:01 -0800
commit80e145fc96765cc0a0f48ae2425294c8c92bce56 (patch)
tree25664bb27068449a082973736e35e1c43bee249b /etc
parentcb0f6348956761880069e8ff7ed5086a177a521a (diff)
downloademacs-80e145fc96765cc0a0f48ae2425294c8c92bce56.tar.gz
emacs-80e145fc96765cc0a0f48ae2425294c8c92bce56.zip
Avoid losing info when formatting integers
* doc/lispref/numbers.texi (Integer Basics): Clarify that out-of-range integers are treated as floating point only when the integers are decimal. * etc/NEWS: Mention changes. * src/editfns.c (styled_format): Use %.0f when formatting %d or %i values outside machine integer range, to avoid losing info. Signal an error for %o or %x values that are too large to be formatted, to avoid losing info.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS7
1 files changed, 7 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 07f6d04a740..14926ba2e3b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -302,6 +302,10 @@ as new-style, bind the new variable 'force-new-style-backquotes' to t.
302'cl-struct-define' whose name clashes with a builtin type (e.g., 302'cl-struct-define' whose name clashes with a builtin type (e.g.,
303'integer' or 'hash-table') now signals an error. 303'integer' or 'hash-table') now signals an error.
304 304
305** When formatting a floating-point number as an octal or hexadecimal
306integer, Emacs now signals an error if the number is too large for the
307implementation to format (Bug#30408).
308
305 309
306* Lisp Changes in Emacs 27.1 310* Lisp Changes in Emacs 27.1
307 311
@@ -343,6 +347,9 @@ remote systems, which support this check.
343If the optional third argument is non-nil, 'make-string' will produce 347If the optional third argument is non-nil, 'make-string' will produce
344a multibyte string even if its second argument is an ASCII character. 348a multibyte string even if its second argument is an ASCII character.
345 349
350** (format "%d" X) no longer mishandles a floating-point number X that
351does not fit in a machine integer (Bug#30408).
352
346** New JSON parsing and serialization functions 'json-serialize', 353** New JSON parsing and serialization functions 'json-serialize',
347'json-insert', 'json-parse-string', and 'json-parse-buffer'. These 354'json-insert', 'json-parse-string', and 'json-parse-buffer'. These
348are implemented in C using the Jansson library. 355are implemented in C using the Jansson library.