From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26105 invoked by alias); 17 Apr 2011 13:47:04 -0000 Received: (qmail 26078 invoked by uid 22791); 17 Apr 2011 13:47:03 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL,TW_BG X-Spam-Check-By: sourceware.org Received: from out01.dlls.pa.frontiernet.net (HELO out01.dlls.pa.frontiernet.net) (199.224.80.228) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 17 Apr 2011 13:46:50 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAPbuqk0yI+jm/2dsb2JhbACETqFCiWarGI9CgSmDTnoEhWKMMQ Received: from relay04.dlls.pa.frontiernet.net ([199.224.80.247]) by out01.dlls.pa.frontiernet.net with ESMTP; 17 Apr 2011 13:46:46 +0000 X-Previous-IP: 50.35.232.230 Received: from quava.localdomain (unknown [50.35.232.230]) by relay04.dlls.pa.frontiernet.net (Postfix) with ESMTPA id 38E7F2F80A8; Sun, 17 Apr 2011 13:46:27 +0000 (UTC) Message-ID: <4DAAEF13.7060502@frontier.com> Date: Sun, 17 Apr 2011 13:47:00 -0000 From: Jerry DeLisle User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 MIME-Version: 1.0 To: "thenlich at users dot sourceforge.net" CC: gcc-bugs@gcc.gnu.org Subject: Re: [Bug libfortran/48602] Invalid F conversion of G descriptor for values close to powers of 10 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg01766.txt.bz2 On 04/17/2011 06:25 AM, thenlich at users dot sourceforge.net wrote: --- snip --- > > I agree. > > Let's open a new bug for this. This bug is about the correct choice of format, > not about rounding (this is somewhere else in the code). > Yes, new PR. We are using builtin snprintf for DTOA. #define DTOA \ snprintf (buffer, size, "%+-#" STR(MIN_FIELD_WIDTH) ".*" \ "e", ndigits - 1, tmp); By examining the buffer returned, we are getting an exact value back before we even begin processing the string for our libgfortran needs. The buffer for this case contains: buffer=990e-02 The first digit is an artifact of shifting the buffer for decimal point placement and is ignored. I still need to check the code between the call to snprintf and where I have placed a printf to view it. snprintf may be rounding the value up. Testing continues.