This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch,libfortran] PR37472 bad output on default-format write of double
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 22 Dec 2008 06:26:49 -0800
- Subject: [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)\
{ \