hello everybody,
during an intense programming session I stumbled accross a very strange problem. Have a look at the following simple program:
program test
implicit none
real(kind(1.0d0)), parameter :: real_const = 3.14159265358979
real(kind(1.0d0)) :: real_variable
real(kind(1.0d0)) :: real_variable_readin
character(128) :: real_char
real_char = '3.14159265358979'
real_variable = 3.14159265358979
read(real_char,*), real_variable_readin
write(*,*), real_variable
write(*,*), 2*acos(0.0d0)
write(*,*), real_variable_readin
end program test
The Ouptput should be three times the same value:
3.14159265358979
3.14159265358979
3.14159265358979
BUT IT IS NOT --> on my computer the output looks like this:
3.14159274101257
3.14159265358979
3.14159265358979
I'm using g95 (newest version 2005-07-14) on a dual opteron workstation running under linux ...
Can anybody tell me what's going on ...
thx
tservas
during an intense programming session I stumbled accross a very strange problem. Have a look at the following simple program:
program test
implicit none
real(kind(1.0d0)), parameter :: real_const = 3.14159265358979
real(kind(1.0d0)) :: real_variable
real(kind(1.0d0)) :: real_variable_readin
character(128) :: real_char
real_char = '3.14159265358979'
real_variable = 3.14159265358979
read(real_char,*), real_variable_readin
write(*,*), real_variable
write(*,*), 2*acos(0.0d0)
write(*,*), real_variable_readin
end program test
The Ouptput should be three times the same value:
3.14159265358979
3.14159265358979
3.14159265358979
BUT IT IS NOT --> on my computer the output looks like this:
3.14159274101257
3.14159265358979
3.14159265358979
I'm using g95 (newest version 2005-07-14) on a dual opteron workstation running under linux ...
Can anybody tell me what's going on ...
thx
tservas