Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 2393 by [email protected]: Sum error
http://code.google.com/p/sympy/issues/detail?id=2393

When defining a function that returns 1 for integers and 0 for everything else the following sum fails:

In [1]: def a(k):
    if type(k) == int or k.is_Integer:
        return 1
    return 0

In [2]: a(5)
Out[2]: 1

In [3]: Sum(a(k),(k,1,10)).doit()
Out[3]: 0


Expected result would be 10.

I may be failing in defining such function, but at least is a strange behaviour.

--
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