On 30/10/2015 2:24 AM, "Marc Glisse"
On Fri, 30 Oct 2015, Jeremy Murphy wrote:
Division is interesting because it's not actually clear to me what the result should be - is it a polynomial (plus remainder) or is it a
rational
function (suitable reduced by the greatest common divisor).
Yes, I was initially troubled by this question but resolved, admittedly more through intuition than proof, that polynomial division is Euclidean (integer) division: the / operator gives you the quotient, and % gives you the remainder. Someone with a deeper understanding of abstract algebra could presumably validate or discredit this claim. However, if one accepts this, then everything falls neatly into place, for example the /= operator makes sense, which it obviously wouldn't otherwise.
This looks like a sensible choice. The situation is pretty similar to integers. 10 / 4 could return a rational type, but the choice was made to stay in the original type and use the Euclidean domain structure instead.
Thanks. Out of curiosity, which choice are you referring to? I presume it must be early in computing history.
You might want to provide a div-like function for people who want both
the quotient and the remainder without duplicating too much computation. Yes, that's exactly what I've done. Cheers.
-- Marc Glisse
_______________________________________________ Unsubscribe & other changes: