From e318b7602bc8f91d9ab4342c50e574734519314a Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Fri, 5 Dec 2008 04:07:45 +0000 Subject: [PATCH] re PR fortran/38285 (Wrong I/O output: Interaction between F and P for output) 2008-12-04 Jerry DeLisle PR fortran/38285 * write_float.def (WRITE_FLOAT): Zero the float value for special case only if scale_factor = 0. From-SVN: r142455 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/io/write_float.def | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 36c0098cab28..bb860d4816f0 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2008-12-04 Jerry DeLisle + + PR fortran/38285 + * write_float.def (WRITE_FLOAT): Zero the float value for special case + only if scale_factor = 0. + 2008-11-23 Thomas Koenig PR libfortran/38234 diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index 8bb4123084f4..d8799f2ae03e 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -760,7 +760,8 @@ sprintf (buffer, "%+-#" STR(MIN_FIELD_WIDTH) ".*" \ return;\ }\ tmp = sign_bit ? -tmp : tmp;\ - if (f->u.real.d == 0 && f->format == FMT_F)\ + if (f->u.real.d == 0 && f->format == FMT_F\ + && dtp->u.p.scale_factor == 0)\ {\ if (tmp < 0.5)\ tmp = 0.0;\