If anyone is interested, I posted a Gist for polynomial division 
at https://gist.github.com/mathpup/8514578. The code using the existing 
polynomial module Polynomial.jl.

My code includes a few utility functions and promotion rules. Since the 
division process repeatedly applies polynomial operations, the division 
function divrem() performs the type promotion once at the beginning to 
avoid repeatedly promoting types inside the main loop. By default, the 
standard div() operator (/) is used. For polynomials with integer 
coefficients, the result will be a polynomial with floating point 
coefficients. I provided the ability to specify // instead of the default 
division operator as a clever way to provide a result with rational 
coefficients for integer polynomials, but I'm not sure how expensive this 
is (since it's done in the main loop). In the grand scheme, I don't know 
how much difference it makes or whether it would ever be an issue.

Reply via email to