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

S.Infinity.is_nonzero returns False #21107

Open
ghost opened this issue Mar 17, 2021 · 4 comments
Open

S.Infinity.is_nonzero returns False #21107

ghost opened this issue Mar 17, 2021 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 17, 2021

>>> sympy.__version__
'1.8.dev'
>>> S.Infinity.is_nonzero
False
@ghost
Copy link
Author

ghost commented Mar 17, 2021

I would like to work on this issue, but I am not able to exactly find where the problem lies.

@jksuom
Copy link
Member

jksuom commented Mar 17, 2021

The meaning of nonzero is not the same as that of 'not zero'.
From sympy/core/assumptions:

   nonzero
        object is a real number that is not zero.

Infinities are not real numbers and therefore S.Infinity.is_nonzero is False.

@ghost
Copy link
Author

ghost commented Mar 17, 2021

Isn't this is a little problematic though?
For example I would expect is_zero and is_nonzero to be complementary of each other .

zero
        object has the value of ``0``.

@oscarbenjamin
Copy link
Contributor

There is is_extended_nonzero which corresponds to the extended reals:

In [3]: oo.is_extended_nonzero
Out[3]: True

skirpichev added a commit to skirpichev/diofant that referenced this issue Mar 20, 2021
@sylee957 sylee957 added the core label Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants