-
Notifications
You must be signed in to change notification settings - Fork 535
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
bound: Add Union helper for bound package #966
Conversation
1b1c557
to
4fc07a2
Compare
b3 := Bound{Min: 1.0, Max: 2.0} | ||
b4 := Bound{Min: 1.1, Max: 2.0} | ||
|
||
ret := Union(b0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall I update this one also into union := Union(b0)
?
My intent was the return value VS expected value
for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can leave the tests. We usually use got
for test results, but this will be rewritten to use tables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay!
@kortschak Please take a look! |
@kortschak I've updated the CL. Please take a look |
Is this function right? If we have [[0, 1], [2, 3], [0.5, 2.5]] this has a valid union of [0,3] but this algorithm will return NaN as far as I can see |
I'll add that to the tests I'm going to write in the next couple of hours and fix it up. It needs to sort the bounds first and then walk them. Thanks for pointing it out. This is why I always use trees for this. |
Add Union helper for bound package
Updates: #939