Skip to content
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

isnan(Dual(1.0,NaN)) == false #15

Open
goretkin opened this issue Dec 10, 2014 · 2 comments
Open

isnan(Dual(1.0,NaN)) == false #15

goretkin opened this issue Dec 10, 2014 · 2 comments

Comments

@goretkin
Copy link

julia> isnan(Dual(1.,NaN))
false

This didn't come up as an issue for me, but I'm curious if this is a deliberate choice.

compare

julia> isnan(1. + (NaN)im)
true
@mlubin
Copy link
Contributor

mlubin commented Dec 10, 2014

Not a deliberate choice, but just following the convention that comparison operations should apply only to the real part. If there's a solid reason to change the behavior, we can definitely do so.

@mlubin
Copy link
Contributor

mlubin commented Dec 10, 2014

This isn't a great citation, but http://www.coin-or.org/CppAD/Doc/doxydoc/html/nan_8hpp_source.html states that isnan(x) should be true iff x != x is true. Since we override !=, the current behavior is consistent with that definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants