* io/format.c (parse_format_list): Set repeat count for P descriptors.
* write.c (output_float): Fix condition. Correctly handle nonzero
scale factor.
testsuite/
* gfortran.dg/edit_real_1.f90: Add new tests.
From-SVN: r86952
+2004-09-02 Paul Brook <paul@codesourcery.com>
+
+ * gfortran.dg/edit_real_1.f90: Add new tests.
+
2004-09-01 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/15327
s = x
write (s, '(EN15.3,A)') 999.9999, "z"
if (s .ne. " 1.000E+03z") call abort
+ ! E format, positive scale factor
+ s = x
+ write (s, '(2PE10.4,A)') 1.2345, "z"
+ if (s .ne. '12.345E-01z') call abort
+ ! E format, negative scale factor
+ s = x
+ write (s, '(-2PE10.4,A)') 1.25, "z"
+ if (s .ne. '0.0013E+03z') call abort
end
+2004-09-02 Paul Brook <paul@codesourcery.com>
+
+ * io/format.c (parse_format_list): Set repeat count for P descriptors.
+ * write.c (output_float): Fix condition. Correctly handle nonzero
+ scale factor.
+
2004-09-01 Eric Botcazou <ebotcazou@libertysurf.fr>
* mk-sik-inc.sh: Use a temporary string instead of 'echo -n'.
p_descriptor:
get_fnode (&head, &tail, FMT_P);
tail->u.k = value;
+ tail->repeat = 1;
t = format_lex ();
if (t == FMT_F || t == FMT_EN || t == FMT_ES || t == FMT_D
edigits = 2;
}
- if (FMT_F || FMT_ES)
+ if (ft == FMT_F || ft == FMT_EN
+ || ((ft == FMT_D || ft == FMT_E) && g.scale_factor != 0))
{
/* Always convert at full precision to avoid double rounding. */
ndigits = 27 - edigits;
case FMT_E:
case FMT_D:
i = g.scale_factor;
+ e -= i;
if (i < 0)
{
nbefore = 0;
nzero = -i;
nafter = d + i;
}
- else
+ else if (i > 0)
{
nbefore = i;
nzero = 0;
- nafter = d - i;
+ nafter = (d - i) + 1;
}
+ else /* i == 0 */
+ {
+ nbefore = 0;
+ nzero = 0;
+ nafter = d;
+ }
+
if (ft = FMT_E)
expchar = 'E';
else