I learned Fortran from ancient people who disregard modern standards. As such, my code consists mainly of that older syntax. I am wondering how well this meshes with(adsbygoogle = window.adsbygoogle || []).push({}); current Fortran environments, specifically regarding double precision calculations. This comes up mainly because I have been told that real*8 and similar declarations should be abandoned in favor of KIND.

For example, in the following code section

will y maintain full double precision, or will a statement like z be required?Code (Fortran):real*8 x,y,z

x=12.3456

y=2*x

z=2.d0*x

Similarly, if the fractional nature of the initial variable is defined only implicitly,

does this change the nature of y or z?Code (Fortran):real*8 pi,y,z

pi=4*atan(1)

y=2*pi

z=2.d0*pi

Or, for that matter, does pi maintain an appropriate value here instead of being declared as pi=4.d0*atan(1.d0)?

Thanks.

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran Modern variable precision and integer multipliers

Have something to add?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**