Search code examples
fortranfortran77pi

Why define PI = 4*ATAN(1.d0)


What is the motivation for defining PI as

PI=4.D0*DATAN(1.D0)

within Fortran 77 code? I understand how it works, but, what is the reasoning?


Solution

  • This style ensures that the maximum precision available on ANY architecture is used when assigning a value to PI.