OSDN Git Service

2008-12-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Dec 2008 14:53:37 +0000 (14:53 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Dec 2008 14:53:37 +0000 (14:53 +0000)
PR libfortran/37472
* io/write_float.def (output_float_FMT_G_): Modify calculation of temp
to avoid sensitivity to round-off.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142884 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/io/write_float.def

index f60c5d0..c04331f 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 a5d292c..f94fde3 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)\
         { \