On Feb 20, 12:35 pm, Burcin Erocal <bur...@erocal.org> wrote:
> Or you can do this:
>
> sage: t = -2/3*x + 4/3
> sage: t._convert(RR)
> -0.666666666666667*x + 1.33333333333333
>
> Cheers,
> Burcin

This is perfect - thank you!  For the record, I've used that idea to
write the following bits:

def convert_dict(d, F):
    # Converts the values in the dictionary d to the field F
    return dict([(k, v._convert(F)) for k, v in d.items()])

def complex_solutions(eqns, vars):
    sol=solve(eqns, vars, solution_dict=True)
    return [convert_dict(d, CC) for d in sol]

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to