diff options
| author | Paul Eggert | 2018-08-22 19:30:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-08-22 19:30:57 -0700 |
| commit | ee641b87cf220250ba89f219fb47a4406a05deb7 (patch) | |
| tree | 08ff44c5197ae39b2ec0906de4bb4dcafda4677f /doc/lispref/errors.texi | |
| parent | be5fe6183e95f3afe3a62ec43504b99df90bc794 (diff) | |
| download | emacs-ee641b87cf220250ba89f219fb47a4406a05deb7.tar.gz emacs-ee641b87cf220250ba89f219fb47a4406a05deb7.zip | |
Fix bugs when rounding to bignums
Also, since Emacs historically reported a range error when
rounding operations overflowed, do that consistently for all
bignum overflows.
* doc/lispref/errors.texi (Standard Errors):
* doc/lispref/numbers.texi (Integer Basics): Document range errors.
* src/alloc.c (range_error): Rename from integer_overflow.
All uses changed.
* src/floatfns.c (rounding_driver): When the result of a floating
point rounding operation does not fit into a fixnum, put it
into a bignum instead of always signaling an range error.
* test/src/floatfns-tests.el (divide-extreme-sign):
These tests now return the mathematically-correct answer
instead of signaling an error.
(bignum-round): Check that integers round to themselves.
Diffstat (limited to 'doc/lispref/errors.texi')
| -rw-r--r-- | doc/lispref/errors.texi | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index a0e32c5631c..e61ea98e210 100644 --- a/doc/lispref/errors.texi +++ b/doc/lispref/errors.texi | |||
| @@ -159,6 +159,11 @@ The message is @samp{No catch for tag}. @xref{Catch and Throw}. | |||
| 159 | The message is @samp{Attempt to modify a protected file}. | 159 | The message is @samp{Attempt to modify a protected file}. |
| 160 | @end ignore | 160 | @end ignore |
| 161 | 161 | ||
| 162 | @item range-error | ||
| 163 | The message is @code{Arithmetic range error}. | ||
| 164 | This can happen with integers exceeding the @code{integer-width} limit. | ||
| 165 | @xref{Integer Basics}. | ||
| 166 | |||
| 162 | @item scan-error | 167 | @item scan-error |
| 163 | The message is @samp{Scan error}. This happens when certain | 168 | The message is @samp{Scan error}. This happens when certain |
| 164 | syntax-parsing functions find invalid syntax or mismatched | 169 | syntax-parsing functions find invalid syntax or mismatched |
| @@ -223,9 +228,6 @@ The message is @samp{Arithmetic domain error}. | |||
| 223 | The message is @samp{Arithmetic overflow error}. This is a subcategory | 228 | The message is @samp{Arithmetic overflow error}. This is a subcategory |
| 224 | of @code{domain-error}. | 229 | of @code{domain-error}. |
| 225 | 230 | ||
| 226 | @item range-error | ||
| 227 | The message is @code{Arithmetic range error}. | ||
| 228 | |||
| 229 | @item singularity-error | 231 | @item singularity-error |
| 230 | The message is @samp{Arithmetic singularity error}. This is a | 232 | The message is @samp{Arithmetic singularity error}. This is a |
| 231 | subcategory of @code{domain-error}. | 233 | subcategory of @code{domain-error}. |