-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 loop on missing non-integer intersect() method for ranges #7760
Comments
Because of rounding issues when slicing The stack overflow should be fixed though. Is it enough to change it to? function intersect(r1::Range, r2::Range, r3::Range, r::Range...)
i = intersect(r1, r2)
i = intersect(i, r3) # Added this line after @quinnj's comment
for t in r
i = intersect(i, t)
end
i
end |
Yep, sorry for the over-use of StepRange; that was how I discovered it, but I've edited the description to "all non-integer ranges", so FloatRanges as well as non-Integer StepRanges. I'm sure FloatRanges would be a pain and a half, as well as a generic StepRange implementation. I think I'll start by trying to do |
And no, your definition above doesn't change anything since |
Sorry, updated the definition to take yet another Range. |
@JeffBezanson, could we remove the type restraint on |
Sure; go ahead and pull request the changes you want for that. |
The fix for this should probably be limited to |
For intersections of 3 or more objects. |
Right now
intersect()
for ranges is only defined forInteger
, so that means we haveBecause it recursively calls the
intersect(r::Range, s::Range...)
definition. The same behavior is obviously the same for date ranges (which is how I discovered this).I'm sure it's not a walk in the park to get something working generically for ranges, but I'll start playing around with it unless someone else has a better idea.
The text was updated successfully, but these errors were encountered: