mirror of https://github.com/python/cpython
fix bug in poly.minus
This commit is contained in:
parent
05bf280d47
commit
971dc53f0e
|
@ -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 = []
|
||||
|
|
Loading…
Reference in New Issue