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?
fortran where most of the Fortran experts hang out. Their conclusion -- specify the constant by pi = 3.14159... (enough digits for required precision then some for safety).
A double-precision exponent consists of the letter D , followed by an optional plus or minus sign, followed by an integer. A double-precision exponent denotes a power of 10. The value of a double-precision constant is the product of that power of 10 and the constant that precedes the D .
ATAN(X) computes the arctangent of X . The type shall be REAL or COMPLEX ; if Y is present, X shall be REAL.
This style ensures that the maximum precision available on ANY architecture is used when assigning a value to PI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With