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? 回答1: This style ensures that the maximum precision available on ANY architecture is used when assigning a value to PI. 回答2: Because Fortran does not have a built-in constant for PI . But rather than typing in the number manually and potentially making a mistake or not getting the maximum possible precision on the given implementation, letting the library