all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>, JD Smith <jdtsmith@gmail.com>
Cc: adam@alphapapa.net, 71572@debbugs.gnu.org, jonas@bernoul.li
Subject: bug#71572: [PATCH] seconds-to-string-approximate
Date: Thu, 4 Jul 2024 08:09:08 +0100	[thread overview]
Message-ID: <3530cd89-b5a2-4b25-95bf-1896c8ee4aef@cs.ucla.edu> (raw)
In-Reply-To: <86msmxafog.fsf@gnu.org>

On 7/4/24 06:29, Eli Zaretskii wrote:

> Basically, this shows that:
> 
>   . mastodon truncates where seconds-to-string rounds

For high precision timestamps it's often better to truncate, for various 
reasons. That's what the C code does with timestamps, anyway. 
seconds-to-string historically has rounded several times which of course 
is not best but apparently is good enough for its intended application area.


>   . seconds-to-string lacks the "1 hour 11 min" output format

That format could be confusing with negative delays, e.g., "-1 hour 11 min".

>   . seconds-to-string sometimes produces inaccurate results, as in
>     5.5 => 5.48s

No, it's the other way round: seconds-to-string is more accurate than 
the alternatives. That's merely a misfeature in the test script. 
seconds-to-string is passed the argument 5.475149999999998, and formats 
it as "5.48" whereas the test script formats it as "5.5".


I'm not sold on the "half" argument; seems like a cuteness rather than a 
feature that's all that useful (among other things, it assumes Unicode 
or something like it). What's really going on here is that there's an 
optional argument specifying style and I imagine that style preferences 
will differ (Mastodon style, etc.).

I imagine that style preferences could proliferate. Is there an ISO or 
similar standard for this sort of thing?






  parent reply	other threads:[~2024-07-04  7:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-15 17:24 bug#71573: [PATCH] seconds-to-string-approximate JD Smith
2024-06-15 17:36 ` Eli Zaretskii
2024-06-17  6:20 ` bug#71573: Related functions from ts.el Adam Porter
2024-06-22 10:55   ` Stefan Kangas
2024-06-22 21:54     ` Adam Porter
2024-06-22  8:45 ` bug#71572: [PATCH] seconds-to-string-approximate Eli Zaretskii
2024-06-22 21:56   ` Adam Porter
2024-06-22 23:42   ` Paul Eggert
2024-06-23  2:16     ` JD Smith
2024-07-04  5:29       ` Eli Zaretskii
2024-07-04  6:04         ` Eli Zaretskii
2024-07-04  7:09         ` Paul Eggert [this message]
2024-07-06 19:29           ` JD Smith
2024-07-06 21:09             ` Paul Eggert
2024-07-11 21:01               ` JD Smith
2024-07-04 15:27         ` JD Smith
2024-07-04 15:59           ` Eli Zaretskii
2024-07-04 17:16             ` JD Smith
2024-07-04 18:06               ` Eli Zaretskii
2024-07-04 16:36           ` Ihor Radchenko
2024-07-04 17:23             ` JD Smith
2024-07-04 17:57               ` Ihor Radchenko
2024-06-23  5:13     ` Eli Zaretskii
2024-07-03 20:32       ` JD Smith
2024-07-04  5:29         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3530cd89-b5a2-4b25-95bf-1896c8ee4aef@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=71572@debbugs.gnu.org \
    --cc=adam@alphapapa.net \
    --cc=eliz@gnu.org \
    --cc=jdtsmith@gmail.com \
    --cc=jonas@bernoul.li \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.