Polynomial long division: Difference between revisions

GP
(add Ada)
(GP)
Line 822:
polyout(q, 'x');
polyout(r, 'x');</lang>
 
=={{header|PARI/GP}}==
This uses the built-in PARI polynomials.
<lang parigp>poldiv(a,b)={
my(rem=a%b);
[(a - rem)/b, rem]
};
poldiv(x^9+1, x^3+x-3)</lang>
 
=={{header|Perl}}==