diff options
| author | Paul Eggert | 2019-08-20 17:34:03 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-08-20 17:36:46 -0700 |
| commit | 396ed88a50fba95cd3b989965defef0130a42c42 (patch) | |
| tree | 95b03c537acf8d65b6d894a283eccf9f1d31a1e8 /src/bignum.c | |
| parent | 7e2090ee80c9099ee953392444e1d73d10e973d4 (diff) | |
| download | emacs-396ed88a50fba95cd3b989965defef0130a42c42.tar.gz emacs-396ed88a50fba95cd3b989965defef0130a42c42.zip | |
Avoid some excess precision in time arithmetic
* doc/misc/emacs-mime.texi (time-date):
Adjust example to match new behavior.
* etc/NEWS: Mention this.
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
Don’t lose underestimate precision of seconds component.
* src/bignum.c (mpz): Grow by 1.
* src/timefns.c (trillion_factor): New function.
(timeform_sub_ps_p): Remove.
(time_arith): Avoid unnecessarily-large hz, by reducing the hz
to a value no worse than the worse hz of the two arguments.
The result is always exact unless an error is signaled.
* test/src/timefns-tests.el (timefns-tests--decode-time):
New function.
(format-time-string-with-zone): Test (decode-time LOOK ZONE t)
resolution as well as its numeric value.
Diffstat (limited to 'src/bignum.c')
| -rw-r--r-- | src/bignum.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bignum.c b/src/bignum.c index 3883d3a3944..90b1ebea876 100644 --- a/src/bignum.c +++ b/src/bignum.c | |||
| @@ -31,9 +31,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 31 | storage is exhausted. Admittedly this is not ideal. An mpz value | 31 | storage is exhausted. Admittedly this is not ideal. An mpz value |
| 32 | in a temporary is made permanent by mpz_swapping it with a bignum's | 32 | in a temporary is made permanent by mpz_swapping it with a bignum's |
| 33 | value. Although typically at most two temporaries are needed, | 33 | value. Although typically at most two temporaries are needed, |
| 34 | time_arith, rounddiv_q and rounding_driver each need four. */ | 34 | rounddiv_q and rounding_driver both need four and time_arith needs |
| 35 | five. */ | ||
| 35 | 36 | ||
| 36 | mpz_t mpz[4]; | 37 | mpz_t mpz[5]; |
| 37 | 38 | ||
| 38 | static void * | 39 | static void * |
| 39 | xrealloc_for_gmp (void *ptr, size_t ignore, size_t size) | 40 | xrealloc_for_gmp (void *ptr, size_t ignore, size_t size) |