I must have fell asleep during output formatting day in Fortran class, because these results are perplexing me. Using gfortran 4.6,
this program
program f1
real :: x=65246514
write(*,*) x
end program f1
results in
65246512.0
This program
program f1
real :: x=65245.6525
write(*,*) x
end program f1
results in
65245.6523
Finally, this program
program f1
real :: x=65226545.6525
write(*,'(F14.4)') x
end program f1
results in
65226544.0000
Clearly, the console output is not what is being assigned to x
. Is there some finite precision result coming in to cause this?