diff options
| author | Paul Eggert | 2017-03-04 23:14:52 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-03-04 23:18:39 -0800 |
| commit | 44e7ee2e356452139156e8175c46f646835d27ff (patch) | |
| tree | 7b877113c8ad6b9e2d64c560354656f7397b3325 /etc | |
| parent | 207de3303076bff1bb392bd407fee0dea892fe40 (diff) | |
| download | emacs-44e7ee2e356452139156e8175c46f646835d27ff.tar.gz emacs-44e7ee2e356452139156e8175c46f646835d27ff.zip | |
Fewer rounding errors with (format "%f" fixnum)
* etc/NEWS: Document this.
* src/editfns.c (styled_format): When formatting integers via a
floating-point format, use long double instead of double
conversion, if long double’s extra precision might help.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/NEWS | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -907,6 +907,14 @@ compares their numerical values. According to this predicate, | |||
| 907 | due to internal rounding errors. For example, (< most-positive-fixnum | 907 | due to internal rounding errors. For example, (< most-positive-fixnum |
| 908 | (+ 1.0 most-positive-fixnum)) now correctly returns t on 64-bit hosts. | 908 | (+ 1.0 most-positive-fixnum)) now correctly returns t on 64-bit hosts. |
| 909 | 909 | ||
| 910 | --- | ||
| 911 | ** On hosts like GNU/Linux x86-64 where a 'long double' fraction | ||
| 912 | contains at least EMACS_INT_WIDTH - 3 bits, 'format' no longer returns | ||
| 913 | incorrect answers due to internal rounding errors when formatting | ||
| 914 | Emacs integers with %e, %f, or %g conversions. For example, on these | ||
| 915 | hosts (eql N (string-to-number (format "%.0f" N))) now returns t for | ||
| 916 | all Emacs integers N. | ||
| 917 | |||
| 910 | +++ | 918 | +++ |
| 911 | ** The new function 'char-from-name' converts a Unicode name string | 919 | ** The new function 'char-from-name' converts a Unicode name string |
| 912 | to the corresponding character code. | 920 | to the corresponding character code. |