-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Inconsistency between findmax
and maximum
with respect to NaN
#22337
Comments
Seems like findmax needs to be updated to match maximum. There should also be tests to check that they agree. |
Note that the behavior of
|
Yes, it's documented to do this. The question is whether it should be changed to match |
Right, I'm just addressing "is this something intended or a bug." I agree that the behaviors should match. |
In 1.1, this works correctly: julia> v = [1.0, NaN, 2.0]
3-element Array{Float64,1}:
1.0
NaN
2.0
julia> findmax(v)
(NaN, 2)
julia> maximum(v)
NaN I think this issue can be closed. (Might be a duplicate of #23209?) |
Seems like it on both counts. Thanks! |
I read this discussion about
max
andmaximum
returningNaN
when the collection includesNaN
. For example,However,
findmax
still returns the maximum among non-NaN values and its index:This seems inconsistent. Is this something intended or a bug?
The text was updated successfully, but these errors were encountered: