This violates certain invariances that users may expect, such as
findmax(x)[1] == maximum(x)
so I would say it is a bug. If we take the “NaN
should propagate” view, it both should be NaN
, but I have no good suggestion for the position returned by findmax
(maybe 0
? yet another corner case). If we take the view that “NaN
encodes missing data”, both should return 2.0
.