This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
problem wirh real*8
- From: antonio fazzolari <antonio dot fazzolari at dlr dot de>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 May 2004 15:28:37 +0200
- Subject: problem wirh real*8
Since I had some precision problem in some programs that I'm running,I
compiled this simple example on Suse Linux 8.2 with gcc version 3.3
20030226 (prerelease).
program precision
implicit none
REAL*8 x,y,z
x=0.123456789
y=0.123456788
z=(x-y)
write(*,fmt='(a6,f19.17)')'x = ',x
write(*,fmt='(a6,f19.17)')'y = ',y
write(*,fmt='(a6,f19.17)') 'x-y = ',z
end
The two double precisions real numbers x, y differ on the 9th digit,
fully in the range of double precision.
The output was instead :
> precision
x = 0.12345679104328156
y = 0.12345679104328156
x-y = 0.00000000000000000
Where is my error? Please help me!
Best regards.