Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

ATAN vs DATAN

Martin_C_
Beginner
2,914 Views
I am unsure what to use for ATAN function when supplying a double as an argument.
The manual states to use ATAN for real (single precision) input/output
The manual states to use DATAN for double precision input/output.
Coding tests show that the type returned is the type input.
I could not find anything in any FORTRAN standard about automatic typing conversions, etc.
Since our program allows global changing of type for the input type as either real or double, what should be used?
0 Kudos
2 Replies
mecej4
Honored Contributor III
2,914 Views
Section 13.6 of the Fortran Standard covers your question.

13.6
Specic names for standard intrinsic functions
Except for AMAX0, AMIN0, MAX1, and MIN1, the result type of the specic function is the same that the
result type of the corresponding generic function reference would be if it were invoked with the same arguments as the specic function.


0 Kudos
Steven_L_Intel1
Employee
2,914 Views
I recommend that you always use the generic name (ATAN here) rather than the specific name. The only reason to use the specifc is if you are passing the function name as an actual argument. Using the generic name will automatically pick the correct function based on the type of the argument.
0 Kudos
Reply