-
Notifications
You must be signed in to change notification settings - Fork 42
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
adding Union complexF type in cor #65
adding Union complexF type in cor #65
Conversation
Codecov Report
@@ Coverage Diff @@
## master #65 +/- ##
=======================================
Coverage 97.37% 97.37%
=======================================
Files 1 1
Lines 381 381
=======================================
Hits 371 371
Misses 10 10
Continue to review full report at Codecov.
|
Do you really mean #63? I don't see why we would use complex numbers to fix that issue. |
I'm sorry I meant #63, I don't know how to change it. I used complex numbers since there is a test that uses them and it failed me with floats:
|
Sure enough, that's what I understood, the result should be the same and equal to 1.0. That's what you get with the Union. This also makes |
This code does not seem to produce a correct result if you e.g. pass a vector of |
Can you please pass me the test with bigFloat that has failed? |
and should be Same with e.g.:
and again we get a wrong type. (note that what you propose is not only "conceptually" wrong, but it is also breaking) Additionally your approach allocates, which should be avoided. |
If you would like to go forward with this PR I would recommend:
|
@josemanuel22 More fundamentally, as you can see I marked #63 with the 2.0 label as it would change the existing behavior, so we can't do that until Julia 2.0 (or at least Statistics 2.0). But even then I'm not sure what would be the correct solution (we might even drop that method which doesn't sound too useful). |
Ah I hadn't seen your new posts. Yeah that would probably work. But it is really worth it? Going over all elements is going to be very costly just to return the number one of the right type... Is that function really useful? I used it at JuliaStats/StatsBase.jl#627 but maybe we can find another approach. |
I agree. I just say what would be the "most correct way to do it". Alternatively we could decide to throw an error. This is something for 2.0 release anyway as you have commented. |
Perfect, thanks a lot for the help. It will then be looked at later. |
Solves ticket #63