summaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-16 18:09:03 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-16 18:09:03 +0000
commit222477eca4a96a2fcc3483897974d11b5c231df4 (patch)
treeb2c3885a1b4b90ae9295856352a0b4b34bc8c6a3 /libgfortran/io
parentd7401838f94babd4165c62f2d81893502918c0ba (diff)
downloadgcc-222477eca4a96a2fcc3483897974d11b5c231df4.tar.gz
* write.c (output_float): special check when writing 0.0 with
EN and ES formats. * pr20480.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96566 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/write.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 9c255d7d69e..88e5280b338 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -411,7 +411,8 @@ output_float (fnode *f, double value, int len)
case FMT_EN:
/* The exponent must be a multiple of three, with 1-3 digits before
the decimal point. */
- e--;
+ if (value != 0.0)
+ e--;
if (e >= 0)
nbefore = e % 3;
else
@@ -428,7 +429,8 @@ output_float (fnode *f, double value, int len)
break;
case FMT_ES:
- e--;
+ if (value != 0.0)
+ e--;
nbefore = 1;
nzero = 0;
nafter = d;