zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: zsh converts a floating-point number to string with too much precision
Date: Sat, 21 Dec 2019 18:11:41 +0000	[thread overview]
Message-ID: <20191221181141.wy4ndiq6qyznod22@chaz.gmail.com> (raw)
In-Reply-To: <20191221175618.oolvw72n26tir2wg@chaz.gmail.com>

2019-12-21 17:56:18 +0000, Stephane Chazelas:
> 2019-12-21 10:43:43 +0100, Roman Perepelitsa:
> [...]
> > There is no simple algorithm that achieves this. I recall reading long
> > papers a few years back that were describing various inventions in
> > this field. They were pretty scary.
> 
> https://github.com/openjdk/jdk/blob/f4af0eadb6eaf9d9614431110ab7fc9c1588966d/src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java#L424
> is not exactly trivial. I enjoyed reading the comments even if I
> have not clue what the the code is doing.
[...]

Microsoft's STL implementation (to_chars) looks about as hairy:
https://github.com/microsoft/STL/blob/264b0d4a167daa9e5499af6d783c9ff22f7af03f/stl/inc/charconv

-- 
Stephane

  reply	other threads:[~2019-12-21 21:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20  1:37 Vincent Lefevre
2019-12-20  3:38 ` Mikael Magnusson
2019-12-20 16:58 ` Stephane Chazelas
2019-12-20 17:12   ` Roman Perepelitsa
2019-12-21  0:50     ` Vincent Lefevre
2019-12-21  8:47       ` Stephane Chazelas
2019-12-21  9:43         ` Roman Perepelitsa
2019-12-21 17:56           ` Stephane Chazelas
2019-12-21 18:11             ` Stephane Chazelas [this message]
2019-12-21 18:20               ` Roman Perepelitsa
2019-12-21 21:28         ` Vincent Lefevre
2019-12-21  1:00   ` Vincent Lefevre

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=20191221181141.wy4ndiq6qyznod22@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).