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

fortran, fortran77, pi

Solution

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

Problem

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?

Original source

Related problems