diff options
| author | Paul Eggert | 2018-03-08 20:55:55 -0800 |
|---|---|---|
| committer | Paul Eggert | 2018-03-08 20:57:01 -0800 |
| commit | 80e145fc96765cc0a0f48ae2425294c8c92bce56 (patch) | |
| tree | 25664bb27068449a082973736e35e1c43bee249b /doc | |
| parent | cb0f6348956761880069e8ff7ed5086a177a521a (diff) | |
| download | emacs-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 'doc')
| -rw-r--r-- | doc/lispref/numbers.texi | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index e692ee1cc2f..f1180cf754b 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi | |||
| @@ -53,8 +53,9 @@ but many machines provide a wider range. Many examples in this | |||
| 53 | chapter assume the minimum integer width of 30 bits. | 53 | chapter assume the minimum integer width of 30 bits. |
| 54 | @cindex overflow | 54 | @cindex overflow |
| 55 | 55 | ||
| 56 | The Lisp reader reads an integer as a sequence of digits with optional | 56 | The Lisp reader reads an integer as a nonempty sequence |
| 57 | initial sign and optional final period. An integer that is out of the | 57 | of decimal digits with optional initial sign and optional |
| 58 | final period. A decimal integer that is out of the | ||
| 58 | Emacs range is treated as a floating-point number. | 59 | Emacs range is treated as a floating-point number. |
| 59 | 60 | ||
| 60 | @example | 61 | @example |