From: Guido van Rossum Date: Thu, 20 Oct 1994 22:02:03 +0000 (+0000) Subject: fix bug in poly.minus X-Git-Tag: v1.1.1~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=971dc53f0ede0945dda9471596e4c727ea23dc7c;p=thirdparty%2FPython%2Fcpython.git fix bug in poly.minus --- diff --git a/Lib/poly.py b/Lib/poly.py index 3a21904c18d3..57bd2032d4cf 100644 --- a/Lib/poly.py +++ b/Lib/poly.py @@ -20,11 +20,8 @@ def plus(a, b): return normalize(res) def minus(a, b): - if len(a) < len(b): a, b = b, a # make sure a is the longest - res = a[:] # make a copy - for i in range(len(b)): - res[i] = res[i] - b[i] - return normalize(res) + neg_b = map(lambda x: -x, b[:]) + return plus(a, neg_b) def one(power, coeff): # Representation of coeff * x**power res = []