diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-08-20 14:02:30 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-08-20 15:45:59 -0700 |
commit | 5a9552128296478ec74594b45d0728d87450197e (patch) | |
tree | f83d7409a2d62813ed4bb1d8b10215efefca29a3 /test/src/timefns-tests.el | |
parent | a13c64204c8ead966789abf8efe176e4f2d4f599 (diff) | |
download | emacs-5a9552128296478ec74594b45d0728d87450197e.tar.gz emacs-5a9552128296478ec74594b45d0728d87450197e.tar.bz2 emacs-5a9552128296478ec74594b45d0728d87450197e.zip |
Support larger TIMEs in (time-convert TIME t)
Also, improve the doc to match current behavior.
* doc/lispref/os.texi (Time Conversion): Document that
time-convert signals an error for infinite or NaN args,
and that (time-convert TIME t) is exact otherwise.
Mention float-time as an alternative to time-convert.
(Time Calculations): Document that time-add and time-subtract
are exact and do not decrease HZ below the minimum of their args.
* src/timefns.c (decode_float_time): Don’t signal an error for
floating-point arguments whose base-FLT_RADIX exponent is not less
than DBL_MANT_DIG. Instead, convert them to (TICKS . 1) values.
Use two (instead of three) integer exponent comparisons in the
typical case.
* test/src/timefns-tests.el (time-arith-tests):
Add more floating-point tests, including some tests
that the old code fails.
Diffstat (limited to 'test/src/timefns-tests.el')
-rw-r--r-- | test/src/timefns-tests.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el index a30b2de3a5b..48d964d129c 100644 --- a/test/src/timefns-tests.el +++ b/test/src/timefns-tests.el @@ -129,6 +129,12 @@ most-negative-fixnum most-positive-fixnum (1- most-negative-fixnum) (1+ most-positive-fixnum) + 1e1 -1e1 1e-1 -1e-1 + 1e8 -1e8 1e-8 -1e-8 + 1e9 -1e9 1e-9 -1e-9 + 1e10 -1e10 1e-10 -1e-10 + 1e16 -1e16 1e-16 -1e-16 + 1e37 -1e37 1e-37 -1e-37 1e+INF -1e+INF 1e+NaN -1e+NaN '(0 0 0 1) '(0 0 1 0) '(0 1 0 0) '(1 0 0 0) '(-1 0 0 0) '(1 2 3 4) '(-1 2 3 4) |