Polynomial long division: Difference between revisions

Content added Content deleted
(OCaml example)
Line 342: Line 342:


let zip op p q =
let zip op p q =
let gap = (deg p) - (deg q) in
let gap = (List.length p) - (List.length q) in
if gap = 0 then List.map2 op p q else
if gap = 0 then List.map2 op p q else
if gap > 0 then List.map2 op p (pad gap q)
if gap > 0 then List.map2 op p (pad gap q)
Line 395: Line 395:
r = -23.*x + -14.
r = -23.*x + -14.
</pre>
</pre>

=={{header|Python}}==
=={{header|Python}}==
{{works with|Python 2.x}}
{{works with|Python 2.x}}