From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by sourceware.org (Postfix) with ESMTPS id 676963858D35 for ; Thu, 25 Nov 2021 12:45:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 676963858D35 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MC2sH-1mvUOU3pd7-00CU5Y for ; Thu, 25 Nov 2021 13:45:07 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id E6E71A80D44; Thu, 25 Nov 2021 13:45:06 +0100 (CET) Date: Thu, 25 Nov 2021 13:45:06 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: possible snprintf() regression in 3.3.2 Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20211122232302.GI10332@venus.tony.develop-help.com> <20211123173409.0db4d5ccd94501ce1b8f69ea@nifty.ne.jp> <20211124124055.a90e254858b66d42aca6ecef@nifty.ne.jp> <20211124175204.ff0751fd1536dde626826dd5@nifty.ne.jp> <20211124181456.d4bfca4c5ba33dfe4e701fa4@nifty.ne.jp> <20211125210201.7627ca1c2cac69e5f1833516@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211125210201.7627ca1c2cac69e5f1833516@nifty.ne.jp> X-Provags-ID: V03:K1:ix45ZadPDc73oHjTPM/GYcYWZUf1vOfWzJ64VVgH10DAzvGgLHW k8gjCvxguuk4i7RKx/EXOFjoAuy5CSsRMz2plZDCSSB/7wQDEurEHE3ORMqGsb31ih0YbJB SxIjLrM8s/3J/6wXmkg5dweYjh3IV44g5Pn7yWkPN7+9BDRKJytfjeRK1nmc90758XMoJyp omQSW80YdQwqgBHLl0akQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:kXGC+OLfnf0=:nE1DqxkeeEF2T9qvTi2a/m pXoT3V6Nf2b0iZtMdIYW0CdH5U8CPpzADqDA1JSKwK3VKxxcf3tJ8ogys1Ozu/bg+Wn2aplCr dzG+Mn4Gm+a3ChlA43ZbclbpPRaMajwpFZ0qDlsaCpD3ytJbcEBCi986GZWshi2DVL8BNy0Gk NMZkpUz03PzefaLQGDy8dJuDcTSKauJuQl+C9HO/XsJdCPJYyOLCVDgMXbqmxyrQmpUhqPR2O mAgOvvxUkqEbsEY7H2UotUa9OGRGLILZMswUuWfYUIrhWCcNsq0BFUf1l+TQEuJYfr8ujskTj NO0+eEgTSboNNl9KqA8Z/FsvRaR4SAmdBIK0ae+/hX3faZtrjvCZM79RAvze4LV5JEi1zkKS6 wAfrOGPU9rp4AO6ROLySQFv1j+7dPDi6mYa3G3v6HMpZD707kNEDiGKR+pr8CT+mwa2JFJoDy LegRyten4huSEHsaocj3praDddXXy6+9+inqZOKHIYGUZ6wWL7c/ZRsrbZ4c24hGpuCPKLk+y 5Knw3snUJI2irCpGU1tIlB6/rjnU2hEV3T9npDgYxX49jNoHHHm2l4ybbWC1OmXj3llUtfUUi 0b9GL8lGrTlM6vpZYbs1YDiZcRavoc8toQv5ozTBN7zIfO9h2lKJBwiHRWkBaMd6u7VJ9VE9v /yUdkG2pSA3+ID9x48Hb19MyiVa3izmVshivvhIhcZauPk34ensWQ399xDqIf9008aPU0YwOF eikZVSn+iyu/tY7I X-Spam-Status: No, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2021 12:45:11 -0000 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