--- Comment #11 from dominiq at lps dot ens dot fr 2007-10-03 19:34 ---
BTW I have forgotten to explain why I have to use an auxiliary variable 'z': if
I usenearest(0.0_8,1.0_8); I get
default_format_1_db.f90:70.29:
if (abs(x-y)>nearest(0.0_8,1.0_8)) print *, x, y, x-y
--- Comment #10 from dominiq at lps dot ens dot fr 2007-10-03 19:30 ---
gcc/testsuite/gfortran.dg/default_format_1.f90 passes the test if I replace
if (y /= x) res = res + 1
by
z=0.0_k
if (abs(x-y)>nearest(z,1.0_k)) res = res + 1
in the two places of test_r8,
--- Comment #9 from fxcoudert at gcc dot gnu dot org 2007-10-02 23:30
---
As I said, the default format is wide enough for powerpc-darwin. It's widely
possible that the new testcase gfortran.dg/default_format_2.f90 fails there,
though, due to the Apple printf() bug. Dominique, if you co
--- Comment #8 from fxcoudert at gcc dot gnu dot org 2007-10-02 23:28
---
Subject: Bug 33469
Author: fxcoudert
Date: Tue Oct 2 23:27:51 2007
New Revision: 128967
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128967
Log:
PR libfortran/33469
* io/write.c (write
--- Comment #7 from dominiq at lps dot ens dot fr 2007-10-02 08:29 ---
Subject: Re: Default formats for real input are not
precise enough
> Part of it is simply a libc bug. There are numbers close to 1.0 and -1.0 that
> the darwin libc can't output properly:
Nice catch! The problem a
--- Comment #6 from fxcoudert at gcc dot gnu dot org 2007-10-02 00:37
---
(In reply to comment #5)
> Hum, the real(16) case looks like loads of fun to come!
Part of it is simply a libc bug. There are numbers close to 1.0 and -1.0 that
the darwin libc can't output properly:
$ cat k2.c
--- Comment #5 from fxcoudert at gcc dot gnu dot org 2007-10-01 23:28
---
Hum, the real(16) case looks like loads of fun to come!
$ cat k.f90
integer, parameter :: k = 16
character(80) :: buf
real(k) :: xk, yk
xk = 1.0_k - epsilon(xk)
write (buf,'(1PG60.40)') xk
read (buf,
--- Comment #4 from dominiq at lps dot ens dot fr 2007-09-19 12:38 ---
Subject: Re: Add one digit to the default formatted output
> Dominique, what is the output of your test program on ppc-darwin?
real(4)
default 808
1PG20.61881
1PG20.7 808
1PG20.8
--
fxcoudert at gcc dot gnu dot org changed:
What|Removed |Added
Severity|enhancement |normal
Component|fortran |libfortran