This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/48602] Invalid F conversion of G descriptor for values close to powers of 10
- From: "jvdelisle at frontier dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 17 Apr 2011 13:47:08 +0000
- Subject: [Bug libfortran/48602] Invalid F conversion of G descriptor for values close to powers of 10
- Auto-submitted: auto-generated
- References: <bug-48602-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48602
--- Comment #18 from jvdelisle at frontier dot com 2011-04-17 13:47:06 UTC ---
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.