Polynomial long division: Difference between revisions

Added APL entry.
m (→‎{{header|REXX}}: added comment as first line)
(Added APL entry.)
Line 208:
Q: x^2 + -9*x + -27
R: -123</pre>
=={{header|APL}}==
<lang APL>div←{
{
q r d←⍵
(≢d) > n←≢r : q r
c ← (⊃⌽r) ÷ ⊃⌽d
∇ (c,q) ((¯1↓r) - c × ¯1↓(-n)↑d) d
} ⍬ ⍺ ⍵
}
</lang>
{{out}}
<pre> N←¯42 0 ¯12 1
D←¯3 1
⍪N div D
¯27 ¯9 1
¯123
</pre>
 
=={{header|BBC BASIC}}==
Anonymous user