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

Compatibility with multi-dimensional arrays; closes #19 #20

Merged

Conversation

mkborregaard
Copy link
Contributor

No description provided.

src/NaNMath.jl Outdated
@@ -44,7 +44,7 @@ using NaNMath as nm
nm.sum([1., 2., NaN]) # result: 3.0
```
"""
function sum{T<:AbstractFloat}(x::Vector{T})
function sum{T<:AbstractFloat}(x::AbstractArray{T})
if size(x)[1] == 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check probably needs to change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To length(a)?

@mlubin mlubin merged commit f614e0c into JuliaMath:master May 30, 2017
@mkborregaard
Copy link
Contributor Author

🎉 Thanks a lot for working so promptly on this

@mkborregaard mkborregaard deleted the replace-Vector-with-AbstractArray branch May 30, 2017 19:52
@mlubin
Copy link
Collaborator

mlubin commented May 30, 2017

When you're happy with what's here, let me know and I can tag a new release.

@mkborregaard
Copy link
Contributor Author

mkborregaard commented May 30, 2017

I'm quite happy now - it'd be nice to have the two-arg versions of the functions for multi-dim arrays too, but that is quite a lot more involved, of course.
I have one last suggested PR that would save me essentially having to do the same thing downstream - dispatching all the one-arg versions with arguments that aren't AbstractVector{<:AbstractFloat} to the Base version.

See what you think - after merging this (or now, if you'd prefer not to merge that PR) I'd be happy for a release. This seems to have solved my problems downstream in Plots :-)

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