Ask Your Question

abelian-grape's profile - activity

2021-06-27 12:11:33 +0200 received badge  Famous Question (source)
2018-11-24 23:28:42 +0200 received badge  Popular Question (source)
2018-11-24 23:28:42 +0200 received badge  Notable Question (source)
2014-10-27 15:36:46 +0200 asked a question How to extract the integer part from a symbolic expressions?

Suppose I solve the following quadratic equation using SAGE and store the solution in two variables, a and b :

sage: x = var('x')
sage: qe = (x^2 - 618*x + 90581 == 0)
sage: a, b = solve(qe, x)

Which gives me the following output:

sage: a
x == 379
sage: b  
x == 239
sage: type(a), type(b)
(sage.symbolic.expression.Expression, sage.symbolic.expression.Expression)

I wish to get the output in this form:

sage: a
379
sage: b  
239
sage: type(a), type(b)
(sage.rings.integer.Integer, sage.rings.integer.Integer)

How can I do this easily?