Polynomial long division: Difference between revisions

m
Make the demonstration example in the header easier to read
m (a bit more formatting of the header matter)
m (Make the demonstration example in the header easier to read)
Line 42:
D: -3 1 0 0 degree = 1
<span class="co1">d(N) - d(D) = 2, so let's shift D towards right by 2:</span>
N: -42 0 -12 1
d: 0 0 -3 1
<span class="co1">N(3)/d(3) = 1, so d is unchanged. Now remember that "shifting by 2"
is like multiplying by x<sup>2</sup>, and the final multiplication
(here by 1) is the coefficient of this monomial. Let's store this
into q:</span>
0 1 2
---------------
q: 0 0 1
<span class="co1">now compute N - d, and let it be the "new" N, and let's loop</span>
N: -42 0 -9 0 degree = 2
D: -3 1 0 0 degree = 1
<span class="co1">d(N) - d(D) = 1, right shift D by 1 and let it be d</span>
N: -42 0 -9 0
Line 74:
D: -3 1 0 0 degree = 1
<span class="co1">looping again... d(N)-d(D)=0, so no shift is needed; we
multiply D by -27 (= -27/1) storing the result in d, then</span>
q: -27 -9 1
<span class="co1">and</span>
N: -42 -27 0 0 -
Line 85:
N: -123 0 0 0 (last N)
<span class="co1">d(N) &lt; d(D), so now r ← N, and the result is:</span>
0 1 2
Anonymous user