ChadGarwick
Technical User
Thank you for taking the time to read this. I am currently going through the text "Classical FORTRAN" and I am having some difficulty understanding a bug. Reading through the text, I am led to believe the the SQRT() function should return a REAL if I pass it a REAL. When I compile this code and I get an integer:
I compile using gfortran in this way:
>gfortran test.for
The output is not what I would expect. I have a number of spaces, and the integer 2 as output:
Am I missing a compiler flag or something? I was under the impression that gfortran should compile f77 without any problems. Is it possible that the gfortran binaries that I downloaded are bad? Any advice would be appreciated. My google searches are not turning up a solution to this problem. I have gone through the text a number of times and can not find any resolution to this issue.
Thank you again for your time.
Code:
A=SQRT(8.0)
PRINT *,A
STOP
END
>gfortran test.for
The output is not what I would expect. I have a number of spaces, and the integer 2 as output:
Code:
2
Thank you again for your time.