- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the following invalid code is accepted and gives "surprising" results at runtime:
program ifort_atan
implicit none
complex :: c = 1.
print *, atan (-c, c)
print *, atan (-c, c*2)
print *, atan (-c*2,c*2)
! print *, atan2(-c,c) ! <- this is diagnosed with ifort/ifx
end
At runtime we get:
(-0.7853982,0.0000000E+00)
(-0.7853982,0.0000000E+00)
(-1.107149,0.0000000E+00)
Apparently the second argument is silently dropped. This can be verified by changing the type of c from complex to real.
Expected: a diagnostic similar to the one for atan2, which is identical to atan for 2 arguments.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That one's dangerous! Wrong answers! I filed a bug report, CMPLRLLVM-57429.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue was resolved in oneAPI 2025.0.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed indeed!
Thanks,
Harald

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