https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111022

--- Comment #20 from john.harper at vuw dot ac.nz ---
With the first test case all the EN outputs were 666. but the Fortran 2018
standard 13.7.2.3.4 paragraph 2 requires that EN0.0 produce 666.E+0 but 
Table 13.2 first ENw.d line appears to require either 666.E+00 or 666.+000 
unless my copy of F2018 is out of date. (I note that the F2023 standard 
removed the ambiguity by including "with w > 0" in the offending line of 
Table 13.2.) However F2018 is unambiguous and agrees with F2023 on 
EN0.0E0, requiring 666.E+0

With the second test case, which used 66600, I think all Jerry's outputs 
are correct.

On Mon, 4 Sep 2023, jvdelisle at gcc dot gnu.org wrote:

> Date: Mon, 4 Sep 2023 17:12:30 +0000
> From: jvdelisle at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org>
> To: John Harper <john.har...@vuw.ac.nz>
> Subject: [Bug libfortran/111022] ES0.0E0 format gave ES0.dE0 output with d too
>      high.
> Resent-Date: Tue, 5 Sep 2023 05:12:45 +1200 (NZST)
> Resent-From: <john.har...@vuw.ac.nz>
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111022
>
> --- Comment #18 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
> With Johns test case from Comment #15 and the patch in Comment #17 I get the
> following:
>
> $ ./a.out
> real kinds 4 8 10 16
> With (A,1X,EN0.0  ) 666.
> With (A,1X,EN0.0  ) 666.
> With (A,1X,EN0.0  ) 666.
> With (A,1X,EN0.0  ) 666.
> With (A,1X,EN0.0E0) 666.
> With (A,1X,EN0.0E0) 666.
> With (A,1X,EN0.0E0) 666.
> With (A,1X,EN0.0E0) 666.
> With (A,1X,ES0.0  ) 7.E+2
> With (A,1X,ES0.0  ) 7.E+2
> With (A,1X,ES0.0  ) 7.E+2
> With (A,1X,ES0.0  ) 7.E+2
> With (A,1X,ES0.0E0) 7.E+2
> With (A,1X,ES0.0E0) 7.E+2
> With (A,1X,ES0.0E0) 7.E+2
> With (A,1X,ES0.0E0) 7.E+2
> ERROR STOP Scale factor out of range in format specifier 'E' or 'D'
>
> Notice that the width of exponents is also minimized and where the exponent is
> zero it is not shown at all.  If I do specify an exponent width it shown. For
> example with exponent width of 4 and changing the value to 66600 I get:
>
> $ ./a.out
> real kinds 4 8 10 16
> With (A,1X,EN0.0  ) 67.E+3
> With (A,1X,EN0.0  ) 67.E+3
> With (A,1X,EN0.0  ) 67.E+3
> With (A,1X,EN0.0  ) 67.E+3
> With (A,1X,EN0.0E4) 67.E+0003
> With (A,1X,EN0.0E4) 67.E+0003
> With (A,1X,EN0.0E4) 67.E+0003
> With (A,1X,EN0.0E4) 67.E+0003
> With (A,1X,ES0.0  ) 7.E+4
> With (A,1X,ES0.0  ) 7.E+4
> With (A,1X,ES0.0  ) 7.E+4
> With (A,1X,ES0.0  ) 7.E+4
> With (A,1X,ES0.0E4) 7.E+0004
> With (A,1X,ES0.0E4) 7.E+0004
> With (A,1X,ES0.0E4) 7.E+0004
> With (A,1X,ES0.0E4) 7.E+0004
> ERROR STOP Scale factor out of range in format specifier 'E' or 'D'
>
> This seems reasonable to me. Other opinions?
>
> -- 
> You are receiving this mail because:
> You reported the bug.
>


-- John Harper, School of Mathematics and Statistics
Victoria Univ. of Wellington, PO Box 600, Wellington 6140, New Zealand.
e-mail john.har...@vuw.ac.nz

Reply via email to