delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/11/25/07:06:31

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25E45385782D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1637841989;
bh=715gXWKCzlbHlY6QIU5x5ILntZwbgTgHX1mSeqhCbh8=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=wyC6kLSFftM+Vjokp2mDwQs7Oor13unhQWWSCusEPreQEm7/oIvITqBDHrhTGPm+T
GbGZZUZkwyIR27yHGNFKE8KNmPnWN4EtTuAYmr/3enTxJrRHaR0A5q1ECIxR/w2Jr8
PY+ecT9f+kTPcsdsx1Ic/Ngd50H7C9H+Eh82cNbw=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9167385782A
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 1APC20I1010198
X-Nifty-SrcIP: [110.4.221.123]
Date: Thu, 25 Nov 2021 21:02:01 +0900
To: cygwin AT cygwin DOT com
Subject: Re: possible snprintf() regression in 3.3.2
Message-Id: <20211125210201.7627ca1c2cac69e5f1833516@nifty.ne.jp>
In-Reply-To: <YZ4FrdeJtPb7B04W@calimero.vinschen.de>
References: <7545bb24-43de-cd7d-0764-55c85f1af957 AT gmx DOT com>
<20211121001613 DOT GH10332 AT venus DOT tony DOT develop-help DOT com>
<YZtyJDXdrMzVR2lJ AT calimero DOT vinschen DOT de>
<YZuVRjYoG40cEGDV AT calimero DOT vinschen DOT de>
<20211122232302 DOT GI10332 AT venus DOT tony DOT develop-help DOT com>
<20211123173409 DOT 0db4d5ccd94501ce1b8f69ea AT nifty DOT ne DOT jp>
<YZy45cStTTgLp0gO AT calimero DOT vinschen DOT de>
<20211124124055 DOT a90e254858b66d42aca6ecef AT nifty DOT ne DOT jp>
<20211124175204 DOT ff0751fd1536dde626826dd5 AT nifty DOT ne DOT jp>
<20211124181456 DOT d4bfca4c5ba33dfe4e701fa4 AT nifty DOT ne DOT jp>
<YZ4FrdeJtPb7B04W AT calimero DOT vinschen DOT de>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, NICE_REPLY_A,
RCVD_IN_DNSWL_NONE, 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: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Wed, 24 Nov 2021 10:28:13 +0100
Corinna Vinschen wrote:
> On Nov 24 18:14, Takashi Yano via Cygwin wrote:
> > On Wed, 24 Nov 2021 17:52:04 +0900
> > Takashi Yano wrote:
> > > The printed value is still something wrong...
> > > sqrt(2)*1e70 should be an integer value.
> > 
> > I mean...
> > 
> > sqrt(2)*1e70 is actually not an integer, however, double has mantissa
> > of only 52 bit. So, (double value)*(5^70*2^70) should be an integer.
> 
> The conversion is a bit inexact, I guess, but that's another problem
> of this old ldto, right?

I looked into this problem and found that:

This problem is in principle unavoidable with current algorithms.
This is because the current algorithm uses a value of 10^n for
the conversion. When n>62, the value does not fit into the 144
bits of the mantissa part of the internal representation in ldtoa.
This degrades the precision.


-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019