Commit 80f6181e by Jerry DeLisle

re PR fortran/57822 (I/O: "(g0)" wrongly prints "E+0000")

2015-02-10 Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/57822
	* io/write_float.def (output_float): Apply fix of previous patch
	to correctly calculate the exponent number of digits and take
	care of wide character output.

From-SVN: r220606
parent 6dc6e7d0
2015-02-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/57822
* io/write_float.def (output_float): Apply fix of previous patch
to correctly calculate the exponent number of digits and take
care of wide character output.
2015-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2015-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/57822 PR libgfortran/57822
......
...@@ -446,7 +446,7 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size, ...@@ -446,7 +446,7 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
skip: skip:
/* Calculate the format of the exponent field. */ /* Calculate the format of the exponent field. */
if (expchar) if (expchar && !(dtp->u.p.g0_no_blanks && e == 0))
{ {
edigits = 1; edigits = 1;
for (i = abs (e); i >= 10; i /= 10) for (i = abs (e); i >= 10; i /= 10)
...@@ -632,7 +632,7 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size, ...@@ -632,7 +632,7 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
} }
/* Output the exponent. */ /* Output the exponent. */
if (expchar) if (expchar && !(dtp->u.p.g0_no_blanks && e == 0))
{ {
if (expchar != ' ') if (expchar != ' ')
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment