Closed mkborregaard closed 7 years ago
I agree with that philosophy - I'd convinced myself that only a subtype of AbstractArray{<:AbstractFloat} could possibly contain NaNs, and thus it was safe. Can you give an example? (presently 1am so off to bed)
julia> isa((1.0,2.0,NaN),AbstractArray{<:AbstractFloat})
false
julia> sum((1.0,2.0,NaN))
NaN
Hah, I didn't realize those functions worked on Tuples too. Then I agree this is too dangerous. Sorry for the bad PR! I'll deal with it downstream. I am now officially happy with this, so a release would be great :-)
This seems potentially misleading. What if someone calls
NaNMath.sum()
on a non-AbstractArray collection that hasNaN
in it? I'd rather throw a missing method error than give an unexpected answer.