- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page