public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0)
@ 2006-07-12 8:13 enrico dot segre at weizmann dot ac dot il
2006-07-12 8:56 ` [Bug fortran/28354] " pinskia at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: enrico dot segre at weizmann dot ac dot il @ 2006-07-12 8:13 UTC (permalink / raw)
To: gcc-bugs
Compiling the following snippet
write(*,100) 0.99999
write(*,100) 0.999999
write(*,100) 0.9999999
write(*,100) 0.99999999
write(*,100) 0.999999999
write(*,100) 0.9999999999
100 format((f3.0))
end
with gcc-gfortran-4.1.1-1.fc5, I get as output
0.
0.
0.
1.
1.
1.
I get similar faulty output with -0.9999..., but with no other number/format
combination I have tried.
I get normal output (i.e. all 1.) with other compilers on other machines, such
as gcc-g77-3.2.2-5 on i686; moreover (if that's relevant)
#include <stdio.h>
int main()
{
printf("%3.0f\n",0.999);
printf("%3.0f\n",0.9999);
printf("%3.0f\n",0.99999);
printf("%3.0f\n",0.999999);
printf("%3.0f\n",0.9999999);
printf("%3.0f\n",0.99999999);
}
gives all ones too, when compiled on the same machine with gcc-4.1.1-1.fc5
--
Summary: 0.99999 printed as 0. instead of 1. by format(f3.0)
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: enrico dot segre at weizmann dot ac dot il
GCC host triplet: i686
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/28354] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
@ 2006-07-12 8:56 ` pinskia at gcc dot gnu dot org
2006-07-12 15:21 ` [Bug libfortran/28354] " fxcoudert at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-12 8:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-07-12 08:56 -------
0.99999 in Fortran is 0.99999f in C.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
2006-07-12 8:56 ` [Bug fortran/28354] " pinskia at gcc dot gnu dot org
@ 2006-07-12 15:21 ` fxcoudert at gcc dot gnu dot org
2006-08-21 11:26 ` fxcoudert at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-07-12 15:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from fxcoudert at gcc dot gnu dot org 2006-07-12 15:21 -------
Confirmed, and not target-specific. I'll look into it.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Component|fortran |libfortran
Ever Confirmed|0 |1
GCC host triplet|i686 |
Last reconfirmed|0000-00-00 00:00:00 |2006-07-12 15:21:52
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
2006-07-12 8:56 ` [Bug fortran/28354] " pinskia at gcc dot gnu dot org
2006-07-12 15:21 ` [Bug libfortran/28354] " fxcoudert at gcc dot gnu dot org
@ 2006-08-21 11:26 ` fxcoudert at gcc dot gnu dot org
2006-08-22 0:25 ` jvdelisle at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-08-21 11:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from fxcoudert at gcc dot gnu dot org 2006-08-21 11:26 -------
OK, right, I don't have time to fix this. I've looked at the rounding code, and
carry propagation, and I think we'd need a new special case to handle that, but
couldn't find a way to do it that doesn't break other cases.
Jerry, Thomas, could you look into this? I find it has a pretty high annoyance
factor, we're outputing wrong numbers.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jvdelisle at verizon dot net
Severity|normal |major
Last reconfirmed|2006-07-12 15:21:52 |2006-08-21 11:26:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
` (2 preceding siblings ...)
2006-08-21 11:26 ` fxcoudert at gcc dot gnu dot org
@ 2006-08-22 0:25 ` jvdelisle at gcc dot gnu dot org
2006-08-28 5:14 ` jvdelisle at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-08-22 0:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jvdelisle at gcc dot gnu dot org 2006-08-22 00:25 -------
I will take this on,
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jvdelisle at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2006-08-21 11:26:32 |2006-08-22 00:25:42
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
` (3 preceding siblings ...)
2006-08-22 0:25 ` jvdelisle at gcc dot gnu dot org
@ 2006-08-28 5:14 ` jvdelisle at gcc dot gnu dot org
2006-08-28 5:17 ` jvdelisle at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-08-28 5:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jvdelisle at gcc dot gnu dot org 2006-08-28 05:14 -------
Subject: Bug 28354
Author: jvdelisle
Date: Mon Aug 28 05:14:05 2006
New Revision: 116502
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116502
Log:
2006-08-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/28354
* io/write.c: Check for special case of zero precision in format
and pre-round the real value.
Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/write.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
` (4 preceding siblings ...)
2006-08-28 5:14 ` jvdelisle at gcc dot gnu dot org
@ 2006-08-28 5:17 ` jvdelisle at gcc dot gnu dot org
2006-08-28 5:18 ` [Bug libfortran/28354] [4.1 Only] " jvdelisle at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-08-28 5:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jvdelisle at gcc dot gnu dot org 2006-08-28 05:17 -------
Subject: Bug 28354
Author: jvdelisle
Date: Mon Aug 28 05:17:09 2006
New Revision: 116503
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116503
Log:
2006-08-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/28354
* gfortran.dg/fmt_zero_precision.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/fmt_zero_precision.f90
Modified:
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] [4.1 Only] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
` (5 preceding siblings ...)
2006-08-28 5:17 ` jvdelisle at gcc dot gnu dot org
@ 2006-08-28 5:18 ` jvdelisle at gcc dot gnu dot org
2006-08-30 15:48 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-08-28 5:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jvdelisle at gcc dot gnu dot org 2006-08-28 05:18 -------
Fixed on 4.2
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|0.99999 printed as 0. |[4.1 Only] 0.99999 printed
|instead of 1. by |as 0. instead of 1. by
|format(f3.0) |format(f3.0)
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] [4.1 Only] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
` (6 preceding siblings ...)
2006-08-28 5:18 ` [Bug libfortran/28354] [4.1 Only] " jvdelisle at gcc dot gnu dot org
@ 2006-08-30 15:48 ` pinskia at gcc dot gnu dot org
2007-04-28 10:42 ` tbm at cyrius dot com
2007-04-28 15:31 ` jvdelisle at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-30 15:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2006-08-30 15:47 -------
Fixed so closing as such.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] [4.1 Only] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
` (7 preceding siblings ...)
2006-08-30 15:48 ` pinskia at gcc dot gnu dot org
@ 2007-04-28 10:42 ` tbm at cyrius dot com
2007-04-28 15:31 ` jvdelisle at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: tbm at cyrius dot com @ 2007-04-28 10:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from tbm at cyrius dot com 2007-04-28 11:42 -------
Still a problem with 4.1. Will this be backported?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libfortran/28354] [4.1 Only] 0.99999 printed as 0. instead of 1. by format(f3.0)
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
` (8 preceding siblings ...)
2007-04-28 10:42 ` tbm at cyrius dot com
@ 2007-04-28 15:31 ` jvdelisle at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-28 15:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from jvdelisle at gcc dot gnu dot org 2007-04-28 16:31 -------
We are so close to a 4.2 release I think we may see 4.2 out before the next
cycle, if any on 4.1. If you are able to build your own version of gfortran, I
would suggest move to 4.2 yourself or even 4.3. Also check the gfortran wiki
for more up to date binaries. I don't know what platform you are using. So
probably no.
Let me know if you need help getting a more recent build.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28354
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-04-28 15:31 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-12 8:13 [Bug fortran/28354] New: 0.99999 printed as 0. instead of 1. by format(f3.0) enrico dot segre at weizmann dot ac dot il
2006-07-12 8:56 ` [Bug fortran/28354] " pinskia at gcc dot gnu dot org
2006-07-12 15:21 ` [Bug libfortran/28354] " fxcoudert at gcc dot gnu dot org
2006-08-21 11:26 ` fxcoudert at gcc dot gnu dot org
2006-08-22 0:25 ` jvdelisle at gcc dot gnu dot org
2006-08-28 5:14 ` jvdelisle at gcc dot gnu dot org
2006-08-28 5:17 ` jvdelisle at gcc dot gnu dot org
2006-08-28 5:18 ` [Bug libfortran/28354] [4.1 Only] " jvdelisle at gcc dot gnu dot org
2006-08-30 15:48 ` pinskia at gcc dot gnu dot org
2007-04-28 10:42 ` tbm at cyrius dot com
2007-04-28 15:31 ` jvdelisle at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).