emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#26259: closed (~f SRFI-19 format broken for small


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#26259: closed (~f SRFI-19 format broken for small nanoseconds values)
Date: Wed, 19 Apr 2017 13:51:02 +0000

Your message dated Wed, 19 Apr 2017 15:50:47 +0200
with message-id <address@hidden>
and subject line Re: bug#26259: ~f SRFI-19 format broken for small nanoseconds 
values
has caused the debbugs.gnu.org bug report #26259,
regarding ~f SRFI-19 format broken for small nanoseconds values
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
26259: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26259
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: ~f SRFI-19 format broken for small nanoseconds values Date: Sun, 26 Mar 2017 03:00:50 +0100
The ~f format specifier in SRFI-19's date->string function is supposed
to produce a decimal string representation of the seconds and nanoseconds
portions of a date together:

scheme@(guile-user)> (use-modules (srfi srfi-19))
scheme@(guile-user)> (date->string (make-date 550000000 56 34 12 26 3 2017 0) 
"~f")
$1 = "56.55"

but it screws up for nanoseconds values in the range (0, 1000000), i.e.,
for any time that lies strictly within the first millisecond of a second:

scheme@(guile-user)> (date->string (make-date 550000 56 34 12 26 3 2017 0) "~f")
$2 = "56.5e-4"

Looks like the fractional seconds value is being formatted through a
mechanism that is not suitable for this purpose, which uses exponent
notation for sufficiently small values and thereby surprises the
date->string code.  Note that just assembling the seconds+fraction value
and putting the whole thing through the same formatter, as opposed to
putting the fractional part through on its own, would fix the above test
cases, and any others with non-zero integer seconds, but would leave
the bug unfixed for the case where the integer seconds value is zero.
Fixing this requires not using any formatting mechanism that would ever
resort to exponent notation for values in the relevant range.

-zefram



--- End Message ---
--- Begin Message --- Subject: Re: bug#26259: ~f SRFI-19 format broken for small nanoseconds values Date: Wed, 19 Apr 2017 15:50:47 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
On Sun 26 Mar 2017 04:00, Zefram <address@hidden> writes:

> scheme@(guile-user)> (date->string (make-date 550000 56 34 12 26 3 2017 0) 
> "~f")
> $2 = "56.5e-4"

Thanks for the report.  Fixed in the the fix for #26260; added the test
case anyway.  Cheers.

Andy


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]