]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/37472 (bad output on default-format write of double in common block...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 22 Dec 2008 14:53:37 +0000 (14:53 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 22 Dec 2008 14:53:37 +0000 (14:53 +0000)
2008-12-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libfortran/37472
* io/write_float.def (output_float_FMT_G_): Modify calculation of temp
to avoid sensitivity to round-off.

From-SVN: r142884

libgfortran/ChangeLog
libgfortran/io/write_float.def

index f60c5d0e8def9ad464fc39e23c1bc7f74a4640fe..c04331f60fe1763f5462acdd46d59abbc4d83ba8 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/37472
+       * io/write_float.def (output_float_FMT_G_): Modify calculation of temp
+       to avoid sensitivity to round-off.
+
 2008-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libfortran/38398
index a5d292ca76cdb1053f0601f7c83daf33064b9ecf..f94fde30b702d14591b964285f8ac2ce50b3fd0e 100644 (file)
@@ -640,8 +640,8 @@ output_float_FMT_G_ ## x (st_parameter_dt *dtp, const fnode *f, \
       GFC_REAL_ ## x temp;\
       mid = (low + high) / 2;\
 \
-      temp = 0.1 * calculate_exp_ ## x (mid) - 0.5\
-            * calculate_exp_ ## x (mid - d - 1);\
+      temp = (calculate_exp_ ## x (mid) - \
+             5 * calculate_exp_ ## x (mid - d - 1)) / 10;\
 \
       if (m < temp)\
         { \