| 1 | initial version |
Here is a full example to my advice from comments:
z=var('z')
f=(z-1/2*I)*(z-pi*I)*(z-sqrt(2)*I)
g=f(z=z*I)
[x[0] for x in g.roots() if x[0] in QQ]
[1/2]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.