diff options
author | Guido van Rossum <guido@python.org> | 1994-10-20 22:02:03 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-10-20 22:02:03 (GMT) |
commit | 971dc53f0ede0945dda9471596e4c727ea23dc7c (patch) | |
tree | 103922a24bdc528b2bc52628fa1c657b046b753d | |
parent | 05bf280d47774d2247f7cfae969d8a4768d38b4d (diff) | |
download | cpython-971dc53f0ede0945dda9471596e4c727ea23dc7c.zip cpython-971dc53f0ede0945dda9471596e4c727ea23dc7c.tar.gz cpython-971dc53f0ede0945dda9471596e4c727ea23dc7c.tar.bz2 |
fix bug in poly.minus
-rw-r--r-- | Lib/poly.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/poly.py b/Lib/poly.py index 3a21904..57bd203 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 = [] |