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

Interval(-oo,oo) contains oo and -oo #10343

Merged
merged 4 commits into from
Jan 5, 2016
Merged

Interval(-oo,oo) contains oo and -oo #10343

merged 4 commits into from
Jan 5, 2016

Conversation

shaoron
Copy link
Contributor

@shaoron shaoron commented Dec 31, 2015

Fix #10326 issue
Just add 2 lines to handle (-oo,oo) case

Just add 2 lines to handle (-oo,oo) case
@@ -969,6 +969,8 @@ def _contains(self, other):

if self.start is S.NegativeInfinity and self.end is S.Infinity:
if not other.is_real is None:
if other is S.NegativeInfinity or other is S.Infinity:
return false
Copy link
Member

Choose a reason for hiding this comment

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

I think, we can check for other belonging to extended reals without even checking self for the same.

Move infinities check to other_is_real
@shaoron
Copy link
Contributor Author

shaoron commented Jan 2, 2016

Ok, I move this check.

@asmeurer
Copy link
Member

asmeurer commented Jan 2, 2016

Please add tests.

@shaoron
Copy link
Contributor Author

shaoron commented Jan 2, 2016

I've never written tests. Something like this?

@asmeurer
Copy link
Member

asmeurer commented Jan 5, 2016

Yep, perfect.

asmeurer added a commit that referenced this pull request Jan 5, 2016
Interval(-oo,oo) contains oo and -oo
@asmeurer asmeurer merged commit 713ca36 into sympy:master Jan 5, 2016
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.

3 participants