]> 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)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Fri, 24 Jul 2020 18:47:47 +0000 (20:47 +0200)
commitaa7e7eff5ec165dc8463a0e74309801b15d1feda
tree237c249a7dcaafe8c18ac9b32062f9b5b4eb208c
parent05e0971bcf94a481cbfa2731484f024a67dbd4a5
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