X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BA683858D35
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1637844340;
	bh=LhPz454yMFtcGKvRAS83IDERLSOOhtDgEmJN2KcazKA=;
	h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=fyOtIiHTl5YgoKYkUW09cZg4Q35aqloaGr+mhzFdDEG31BJ2G2puUPo37e71EohIy
	 NjK71oV2lRdst0VENGWsDY+zVP9t/ejJEO3sxm4U7UYK8Xc55LtJ9nRS7+oGEAxnKZ
	 yNadnaBRdQVXPpMgXpPDJpdE2+j+9unZbbJVZfFA=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 676963858D35
Date: Thu, 25 Nov 2021 13:45:06 +0100
To: cygwin@cygwin.com
Subject: Re: possible snprintf() regression in 3.3.2
Message-ID: <YZ+FUtkmEGX92opF@calimero.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <YZtyJDXdrMzVR2lJ@calimero.vinschen.de>
 <YZuVRjYoG40cEGDV@calimero.vinschen.de>
 <20211122232302.GI10332@venus.tony.develop-help.com>
 <20211123173409.0db4d5ccd94501ce1b8f69ea@nifty.ne.jp>
 <YZy45cStTTgLp0gO@calimero.vinschen.de>
 <20211124124055.a90e254858b66d42aca6ecef@nifty.ne.jp>
 <20211124175204.ff0751fd1536dde626826dd5@nifty.ne.jp>
 <20211124181456.d4bfca4c5ba33dfe4e701fa4@nifty.ne.jp>
 <YZ4FrdeJtPb7B04W@calimero.vinschen.de>
 <20211125210201.7627ca1c2cac69e5f1833516@nifty.ne.jp>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20211125210201.7627ca1c2cac69e5f1833516@nifty.ne.jp>
X-Prov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score=-98.9 required=5.0 tests=BAYES_00,
 GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS,
 KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,
 SPF_NEUTRAL, 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@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

On Nov 25 21:02, Takashi Yano via Cygwin wrote:
> 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.

Thanks for checking.

Corinna

-- 
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
