Robert
sage: R.<t> = QQ[]
sage: p = R.random_element()
sage: q = R.random_element()
sage: p
-t^2 - 1/2*t + 1/2
sage: q
-t - 4/3
sage: p.quo_rem(q)
(t - 5/6, -11/18)
Best regards,
Simon
sage: p//q
t - 5/6
sage: p%q
-11/18
p=x^2+x+5
q=x-4
R.<x>=QQ[]
R(p).quo_rem(q)
Robert.
No. But you have the order a little wrong (though what you write
will work). It should be:
R.<x> = QQ[] # or x = polygen(QQ)
p = x^2 + x + 5
q = x - 4
p.quo_rem(q)
William