Euclindean algorithm for polynomials



Hello,
 Is there a routine which performs the Euclidean algotithm for polynomials.

I.e.,  p, q are polynomials with degree(p) = d > degree(q) =s,
I want to obtain

    p = k*q + r
 where k, r are polynomials and degree(r) < s.

TIA,
 -sen