Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3167 by [email protected]: e.is_integer wrong
http://code.google.com/p/sympy/issues/detail?id=3167

    >>> e = -3 - sqrt(5) + (-sqrt(10)/2 - sqrt(2)/2)**2
    >>> e.is_integer
    False
    >>> ask(Q.integer(e))
    False

In both cases, it should return None (at worst) or True (at best). It falters in the old system because it is assumed that if all the terms are not integers then an Add cannot be an integer. While the positive can be affirmed (if all terms are integers the result is an integer), the reverse cannot be (if any term is not an integer then the result cannot be an integer). It would be true that if one term were not an integer then the result is not an integer, but cancellation in two terms is what causes the problem.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to