-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace nonstandard isnan() call with value input checks instead #2061
Conversation
The regression test results:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a final comment, I wonder whether the original code is correct? Would setting angle = pi
be better when tmp1 / tmp2
is less than -1
?
I'm unsure. That does make sense, but I was hesitant to modify the logic in a way that deviates from the original. Since the final result is a |
Agreed that we shouldn't try to "correct" the computation, as we may be missing some important details. As a final comment, I'd suggest trying to match the whitespace convention used in the rest of the |
Fixed, though I do wish we had a format checker, as a significant portion of the file's code (and the original logic that this PR replaces) don't follow this. |
TYPE: bug fix
KEYWORDS: compilation, nonstandard
SOURCE: internal
DESCRIPTION OF CHANGES:
Problem:
PR #1944 introduced a nonstandard function call
isnan()
which breaks compilation for compilers which don't support this extension.Solution:
A potential alternative is to use the
ieee_is_nan()
call fromieee_arithmetic
. As there is conditional compilation of this module which requires Fortran 2003 standard, an easier alternative is just to check the input values before callingacos()