On Tue, 5 Nov 2013 17:51:00 -0800 (PST), chovd...@gmail.com wrote:
        result  +=  ((-1) ** (k+1))/2*k-1

One of two things are happening here. Maybe both.

You're using Python 2.x (and should havesaid so) where integer division is truncated.

You're missing around some part of the intended denominator. Check operator precedence rules.

--
DaveA

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to