Polynomial long division: Difference between revisions

Undo revision 105246 by 75.149.84.28 (talk) [This change resulted in the wrong result]
(Added Delphi example)
(Undo revision 105246 by 75.149.84.28 (talk) [This change resulted in the wrong result])
Line 2,693:
 
from itertools import izip
from math import fabs
 
def degree(poly):
Line 2,710 ⟶ 2,709:
mult = q[dN - dD] = N[-1] / float(d[-1])
d = [coeff*mult for coeff in d]
N = [fabs ( coeffN - coeffd ) for coeffN, coeffd in izip(N, d)]
dN = degree(N)
r = N
1,481

edits