Polynomial long division: Difference between revisions

m
→‎{{header|Octave}}: specify the builtin to make the poly long div
(octave)
m (→‎{{header|Octave}}: specify the builtin to make the poly long div)
Line 398:
 
=={{header|Octave}}==
Octave has already facilities to divide two polynomials (<code>deconv(n,d)</code>); and the reason to adopt the convention of keeping the higher power coefficient first, is to make the code compatible with builtin functions: we can use <tt>polyout</tt> to output the result.
 
<lang octave>function [q, r] = poly_long_div(n, d)
Line 436:
[q, r] = poly_long_div([1,3], [1,-12,0,-42]);
polyout(q, 'x');
polyout(r, 'x');</lang>
 
=={{header|Python}}==