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

Dispatch non Float-arrays to Base methods #21

Closed
wants to merge 2 commits into from

Conversation

mkborregaard
Copy link
Contributor

No description provided.

@mlubin
Copy link
Collaborator

mlubin commented May 30, 2017

This seems potentially misleading. What if someone calls NaNMath.sum() on a non-AbstractArray collection that has NaN in it? I'd rather throw a missing method error than give an unexpected answer.

@mkborregaard
Copy link
Contributor Author

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)

@mlubin
Copy link
Collaborator

mlubin commented May 31, 2017

julia> isa((1.0,2.0,NaN),AbstractArray{<:AbstractFloat})
false

julia> sum((1.0,2.0,NaN))
NaN

@mkborregaard
Copy link
Contributor Author

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 :-)

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

Successfully merging this pull request may close these issues.

2 participants