From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id DBA8F1F55B for ; Wed, 20 May 2020 10:04:17 +0000 (UTC) Received: from localhost ([::1]:52508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbLaC-0006tI-N8 for normalperson@yhbt.net; Wed, 20 May 2020 06:04:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbLa9-0006sx-P8 for bug-gnulib@gnu.org; Wed, 20 May 2020 06:04:13 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:40101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbLa8-00059f-Ri for bug-gnulib@gnu.org; Wed, 20 May 2020 06:04:13 -0400 Received: by mail-pf1-x429.google.com with SMTP id x2so1305414pfx.7 for ; Wed, 20 May 2020 03:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nDQMyyWm+lx7fgPmnVjiSDKM3lfdriUbiRIlYQeQo58=; b=X/6fzFzfeHqV+MessSlYU9kkMvs0cJV60nS2ktIsowmVKlzyDn3eGR6PPSwkcsO7N2 HAIjYpHKEmkG6VpOjwfMf5ktAsLMRsrsoNxLj7q6SrkCJ5txp4w5uTMRxEc/WnOs1AMO w5qArFaJOFXApQ0pjpHyCv6C6+3mybYCXyH0MrkCJPOHChnvtdlRhV0qWvod0zzlrNXk K03EN6zhSlWc0duSl7tfS+2omvaId5YDiRfLDKL2W+j90LYEoUyADJZqQeiXW0of2Z/6 vBhiFs4n3WW7ETuNuGD+tZWdFo1FykNkRF7Pt45JN0ZLgWWFf6P6uG3yQLrrflDL4Eqd wwwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nDQMyyWm+lx7fgPmnVjiSDKM3lfdriUbiRIlYQeQo58=; b=c7m0Qs50DaoMszFQQ3NCVjBMVn7QXd5obWL7dDnnQj9z718hkRfZ84SIxGxakXVma9 uextFLH4fhLTX8TJIQJyqc6Dj3o4Hd34BIeVC0T44DxYbrwV8eG/fDoTxQb3iAOtzYhN xm25oVfBfvDgAv6HEn9q64zeSLQwnpqKBA4H7AM1lCK4iJuJ+O+uCYCC7DCh2tcamMID by954ehU1hOm2EscGp3Gd87R607b0soKfVDP7wkPUK1Hm1ks/9dfhKuSsiNb9VlDWX18 z+pcULfslb7wdziIE3Oh2a/lIEAS5Eo2h7YaiWRrW2zMwnCs6NfwcMDHL32Uf6Teeqw2 bnlQ== X-Gm-Message-State: AOAM530dvdNQtX6avvcbjp89OXlKr738OBtRKSH9cgEo/25niFEs2lN4 0U1vqQOA6dIKtNskIAf7POy4D230d8jGs/DH+Es= X-Google-Smtp-Source: ABdhPJwc0z1LJO+/CxgzdxdDedET9cbXl/H3sNDSxz4cZFlq3NhRXrY3OhQMPJJguquy+re3jJYDX+lZi1XmhJZDusI= X-Received: by 2002:a65:4947:: with SMTP id q7mr3445836pgs.23.1589969051305; Wed, 20 May 2020 03:04:11 -0700 (PDT) MIME-Version: 1.0 References: <9817931.4WPAKDlFbJ@omega> In-Reply-To: <9817931.4WPAKDlFbJ@omega> From: =?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkirchen?= Date: Wed, 20 May 2020 12:04:00 +0200 Message-ID: Subject: Re: Easy Accurate Reading and Writing of Floating-Point Numbers To: Bruno Haible Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=marc.nieper@gmail.com; helo=mail-pf1-x429.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkirchen?= , bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Am Mi., 20. Mai 2020 um 00:37 Uhr schrieb Bruno Haible : > Marc Nieper-Wi=C3=9Fkirchen wrote: > > for output, the shortest rounded > > representation that still reads back accurately has to be selected. > > ... > > A simple algorithm is given by Aubrey Jaffer in [1]. > > > > [1] http://people.csail.mit.edu/jaffer/III/EZFPRW This was just one, which I liked because of its simplicity. (And because it is written in my favorite programming language.) [...] > There are several other algorithms for this purpose. There is also the new Ryu algorithm by Ulf Adams, see [2]. Interestingly, he has found some problems in Jaffer's algorithm, see the paper [3]. [...] > Then there's also the algorithm, by Michael Stoll and me (1990), > in GNU clisp and CLN (based on multiprecision arithmetic, not hardware fl= oats). I didn't know this; I will check this out. The initial version of "c_dtoastr" will, however just work as "dtoastr" doe= s. Marc -- [2] https://github.com/ulfjack/ryu [3] https://dl.acm.org/doi/10.1145/3296979.3192369