It appears that double precision assignment has an issue. The following program:
program test
implicit none
real(kind=4) :: pi1=acos(-1.)
real(kind=8) :: pi2=acos(-1._8)
print *,pi1,pi2
pi2 = real(pi1,8)
print *,pi1,pi2
pi1 = 1.
pi2 = real(pi1,8)
print *,pi1,pi2
end program test
produces the following output:
3.141593 3.141592653589793
3.141593 3.141592741012573
1.000000 1.000000000000000
It appears that the second assignment to p2 is incorrect. Shouldn’t the extra double precision digits in variable ‘pi2’ be zeroed out as in the 3rd assignment? Is this a problem?
Thanks.
Tom