On Wed, Jun 1, 2011 at 7:30 AM, zsharon <[email protected]> wrote:
> Hi,
>
> I need to determine if a given algebraic number is rational.  Here is
> the setup:
>
> PolynomialRing(ZZ, 'x')
> A=-2
> B=5
> f=x^3 + A*x +B
> D=-4*A^3-27*B^2
> L.<c> = NumberField(f)
>
> Then I need to know if a given number beta=b0+b1*c+b2*c^2 is rational
> or not.  It tried using
>
> K.<s>=QQ.extension(beta.minpoly())
> K==QQ
>
> but I'm not sure if this is reliable.

To test membership, just do

    sage: beta in QQ

- Robert

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

Reply via email to