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

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