Ask Your Question

skypluto's profile - activity

2020-08-27 20:03:07 +0100 received badge  Nice Question (source)
2018-11-30 17:20:45 +0100 received badge  Famous Question (source)
2018-11-30 17:20:45 +0100 received badge  Notable Question (source)
2018-11-30 17:20:45 +0100 received badge  Popular Question (source)
2012-07-11 01:46:01 +0100 received badge  Supporter (source)
2012-07-11 01:45:43 +0100 marked best answer How to construct a polynomial from string?
sage: R.<x> = QQ[]
sage: f = R('x^3 - x^2 + x -1') 
sage: f.quo_rem(x-2)
(x^2 + x + 3, 5)
2012-07-11 01:45:43 +0100 received badge  Scholar (source)
2012-07-10 11:43:55 +0100 received badge  Student (source)
2012-07-10 02:47:25 +0100 asked a question How to construct a polynomial from string?

Hi,

I can run the following (putting in a .sage file) successfully.

R.<x> = QQ[]

f = x^3 - x^2 + x -1

p = x - 2

print f.quo_rem(p)

But how about I have a string 'x^3 - x^2 + x -1', how can I construct f.

f = SR('x^3 - x^2 + x -1') is not working as there is no member function quo_rem for Expression.

Thanks.