With the code here: ---- program pb character*10 form character*4093 str str=' ' write(form,120) 3,0 write(str(1:3),form) 1.0d0 - 1.110223024625157D-16 print *,str(1:10) 120 format('(f',i2,'.',i2,')') end ----
Compiled with gfortran 4.3.2: the output is 2 With the gfortran 4.2.4 the result is 1 (which is the right one) $ gfortran-4.3 -o pb pb.f && ./pb 2. $ gfortran-4.2 -o pb pb.f && ./pb 1. -- Summary: Display of a value close to 1 shows 2 Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sylvestre dot ledru at inria dot fr http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37863