This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch,libfortran] PR37472 bad output on default-format write of double


Hi all,

With Steve Kargl's help, the following simple patch was found to eliminate this output problem on x86-64. I plan to commit under simple and makes sense to do rule.

Regression tested at both -m32 and -m64.

NIST tested with a minor adjustment to FM907 reference output due to the fixed decimal point alignment. (FM907 is checked by inspection)

I will come up with a suitable test case.

Regards,

Jerry

Index: write_float.def
===================================================================
--- write_float.def	(revision 142883)
+++ write_float.def	(working copy)
@@ -640,8 +640,8 @@ output_float_FMT_G_ ## x (st_parameter_d
       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)\
         { \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]