1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-09 15:50:40 -08:00

time-equal, and time values of infinity and NaN

* doc/lispref/os.texi (Time Calculations):
Document time-equal, and the behavior on NaNs and infinities of
time-less-p, time-add, time-subtract.
* etc/NEWS: Mention the change.
* src/editfns.c (time_arith): Change last arg from function
to bool.  All callers changed.  Do the right thing with
infinities and NaNs.
(time_cmp): New function, which handlesx infinities and NaNs.
(Ftime_less_p): Use it.
(Ftime_equal): New function.
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
Use it.
This commit is contained in:
Paul Eggert 2018-09-27 18:28:27 -07:00
parent 21fc322763
commit 06e2814e1f
4 changed files with 66 additions and 19 deletions

View file

@ -40,10 +40,8 @@
(should (debug-timer-check)) t))
(ert-deftest timer-test-multiple-of-time ()
(should (zerop
(float-time
(time-subtract
(timer-next-integral-multiple-of-time '(0 0 0 1) (1+ (ash 1 53)))
(list (ash 1 (- 53 16)) 1))))))
(should (time-equal
(timer-next-integral-multiple-of-time '(0 0 0 1) (1+ (ash 1 53)))
(list (ash 1 (- 53 16)) 1))))
;;; timer-tests.el ends here