]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve format-seconds accuracy
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Aug 2018 02:03:26 +0000 (19:03 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Aug 2018 02:57:01 +0000 (19:57 -0700)
* 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
lisp/calendar/time-date.el

index adf554e84366a40efbb26f10a3c0b3a18dda349a..c48d08490fdded3f4c31bd95b81dca57c218b2dd 100644 (file)
@@ -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"}.
-
-@emph{Warning:} 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
index 467915e3d9f7f2a08a6ddc879fc5c0f1347651fe..74c607ccb680ae802668a8fdb14ab22fa2a3b554 100644 (file)
@@ -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)