On Thu, Mar 4, 2010 at 8:46 AM, archeryguru2000 <archeryguru2...@gmail.com> wrote: > In running a program I've written, I added a summation as follows: > >>>> Sum((i-i%2)/2, (i, 1, 10)).doit() > > It's actually a liitle more involved than that, but either way below > is the output to that command: > > --------------------------------------------------------------------------- > TypeError Traceback (most recent call > last) > > /home/washu/<ipython console> in <module>() > > TypeError: unsupported operand type(s) for %: 'Symbol' and 'int' > > Should I have expected this result? Should I declare 'i' as something > other than a variable? Anybody else have this problem?
This is what I am getting: In [2]: var("i") Out[2]: i In [3]: Sum((i-i%2)/2, (i, 1, 10)) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/ondrej/repos/sympy/<ipython console> in <module>() TypeError: unsupported operand type(s) for %: 'Symbol' and 'int' In [4]: what do you mean by the i%2? That's the problem. Ondrej -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.