From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id 0F2C8385840B for ; Thu, 4 Nov 2021 16:48:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F2C8385840B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=keithp.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=keithp.com Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id C2F733F3110B; Thu, 4 Nov 2021 09:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1636044520; bh=OPROLFEuFgFpeyJHc7H/nftNq2ZRE7RsRYwlDz2AGl8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=a1nxtXJDQHwlcVSaFkiAzIJsTgNYo5QULTxcot183tV77kSPRXnuJ4VqlMg4bRNLl jmUq4aDbvCGaTXlnQXeMQ7FF7UoQPQV8MsFND26BHuZNlT2XSXi5YYDwXSckcfYtZp P5QNP9NuM7jY0eNMIGuKZa7vyeGojaYCi4jflDWfO+5ccivdqb2d0bX7YCBm53w89A hpUslqaTlT8djT8T13j2j03V3kD5IzDpgpN2YrIMZrnzB/rohTwq4LANE/gU33CkyW jdRAznM8w6DVG25Wp84abjTDTaNoUNhHEYOVDQT7+tSjf7JFUsSNFt04cWKfkCsEja +vyeqY3XHQRMg== X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id HCphcaP-MCkw; Thu, 4 Nov 2021 09:48:40 -0700 (PDT) Received: from keithp.com (koto.keithp.com [192.168.11.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 1945C3F31103; Thu, 4 Nov 2021 09:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1636044520; bh=OPROLFEuFgFpeyJHc7H/nftNq2ZRE7RsRYwlDz2AGl8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=a1nxtXJDQHwlcVSaFkiAzIJsTgNYo5QULTxcot183tV77kSPRXnuJ4VqlMg4bRNLl jmUq4aDbvCGaTXlnQXeMQ7FF7UoQPQV8MsFND26BHuZNlT2XSXi5YYDwXSckcfYtZp P5QNP9NuM7jY0eNMIGuKZa7vyeGojaYCi4jflDWfO+5ccivdqb2d0bX7YCBm53w89A hpUslqaTlT8djT8T13j2j03V3kD5IzDpgpN2YrIMZrnzB/rohTwq4LANE/gU33CkyW jdRAznM8w6DVG25Wp84abjTDTaNoUNhHEYOVDQT7+tSjf7JFUsSNFt04cWKfkCsEja +vyeqY3XHQRMg== Received: by keithp.com (Postfix, from userid 1000) id D44A01E6013A; Thu, 4 Nov 2021 09:48:39 -0700 (PDT) From: Keith Packard To: Corinna Vinschen , Pavel M Cc: newlib@sourceware.org Subject: Re: gcc 11.1.0: printf("%.43f\n", 0x1.52f8a8e32e982p-140): printed value is incorrectly rounded In-Reply-To: References: Date: Thu, 04 Nov 2021 09:48:39 -0700 Message-ID: <87ilx7vpco.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 16:48:43 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Corinna Vinschen writes: > Is anybody here willing to take a look and change Newlib to gdtoa? It might be useful for newlib to adopt the Ry=C5=AB floating point conversi= on code developed by Ulf Adams (currently at Google). This does correct double conversion in 128 bits, avoiding need for arbitrary precision math and any allocations. https://dl.acm.org/doi/10.1145/3360595 There is a BSD licensed implementation of the core algorithm available on github; adopting that into complete printf/scanf implementations isn't a huge amount of work. picolibc uses this implementation. A friend of mine posited that this could be done, and got started on it in grad school about 20 years ago. It was very nice to see someone actually take the time to make it happen. =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAmGEDucACgkQ2yIaaQAA ABF+Jg//V4zi2udVahk5QGZZWCEWmQHcMqIW1E/c8HIXyCN9EJDETSGZV+J3ztpf ZTjXTGWsM8B6wCNiiiXyjs+eHbkr2hEx+w2J7TLSj1wlnLYtwWhvaBDf0aIf1mcM aQ74kFLu36V83ruTStCm/4Ud6PwcpH0YbXf4wGB5H48aXf01EwpJ0S3mRWpZYw30 xoj66pccSPFJ5hJL9KK8l3IcQky0k63Wf7hx10ua3u/L8G9lHujjQz+VJNudZOs0 IZbxtbhZltxfMQ4Hfo5/4ChYdPmVXAaPDjhX6gTAaySvZPU0UwoQ/c15yXq9mYrY 8fr291Ty3dzsEJBV9890R8xTf08CX+1vTWbDNnbcvBtwQDmrdCrmNpZ7bmQN4iHv b8vjxeoUIejWkAgtw403FA7XFU6az239pwYU9/W4SgZUvvsS38yO7wYwT8RTAxau URYo0oKoNgB/tk9/VAwufGmCWRI9EnkP52NeBuuPongGKzd/GDYaexDRdmJh5skf iSwdzEhjG+Dux+r42RYjIaAc4+3ZQljTDvLC3XpL30c34KwrK2lpIGqFi4ZTqX1g tbTotT24a/wqDOd/0/aJfEwxiC2tLR0Szm6et+1YG5OU89jEVE/fEHBhXg1bdF9S yxjkGWdRMCwPX9LSdfJGXTWEmunrJyS8a+HyRuuZ1CPKUckjNeg= =knA4 -----END PGP SIGNATURE----- --=-=-=--