[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 0edf605: Improve format-seconds accuracy
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 0edf605: Improve format-seconds accuracy |
Date: |
Sat, 25 Aug 2018 22:57:06 -0400 (EDT) |
branch: master
commit 0edf60583245cc6f3fd53ddae2f21748a4a1b239
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Improve format-seconds accuracy
* doc/lispref/os.texi (Time Parsing): It works with bignums.
* lisp/calendar/time-date.el (format-seconds):
Take the floor so that the resulting arithmetic is exact.
---
doc/lispref/os.texi | 4 ----
lisp/calendar/time-date.el | 1 +
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index adf554e..c48d084 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1681,10 +1681,6 @@ You can also specify the field width by following the
@samp{%} with a
number; shorter numbers will be padded with blanks. An optional
period before the width requests zero-padding instead. For example,
@code{"%.3Y"} might produce @code{"004 years"}.
-
address@hidden:} This function works only with values of @var{seconds}
-that don't exceed @code{most-positive-fixnum} (@pxref{Integer Basics,
-most-positive-fixnum}).
@end defun
@node Processor Run Time
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 467915e..74c607c 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -303,6 +303,7 @@ is output until the first non-zero unit is encountered."
(push match usedunits)))
(and zeroflag larger
(error "Units are not in decreasing order of size"))
+ (setq seconds (floor seconds))
(dolist (u units)
(setq spec (car u)
name (cadr u)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 0edf605: Improve format-seconds accuracy,
Paul Eggert <=