]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR 93567, G edit descriptor uses E instead of F editing in rounding mode UP.
authorDominique d'Humieres <dhumieres.dominique@free.fr>
Fri, 24 Jul 2020 18:27:53 +0000 (20:27 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:19:21 +0000 (13:19 -0300)
commit248f1891510e12c99845039d9e7b259fbb538668
treea0b80e5c7ad2fc7f2749a8ecca08340c6d4edb76
parent32102477606782ad53a2065d16ac57da43f5c7d3
PR 93567, G edit descriptor uses E instead of F editing in rounding mode UP.

The switch between FMT_E and FMT_F is based on the absolute value.
Set r=0 for rounding toward zero and r = 1 otherwise.
If (exp_d - m) == 1 there is no rounding needed.

libgfortran/ChangeLog:

PR fortran/93567
* io/write_float.def (determine_en_precision): Fix switch between
FMT_E and FMT_F.

gcc/testsuite/ChangeLog:

PR fortran/93567
* gfortran.dg/round_3.f08: Add test cases.
gcc/testsuite/gfortran.dg/round_3.f08
libgfortran/io/write_float.def