On Sat, Mar 3, 2012 at 12:17 PM, Sergiu Ivanov <[email protected]> wrote: > On Sat, Mar 3, 2012 at 6:29 PM, prateek papriwal > <[email protected]> wrote: >> yes u were right i had an old version 6.7 , now i have a new version which >> gives "NONE" for >> >>>>>sqrt(3).is_rational >> and >> >>>>>sqrt(3).is_irrational >> >> this need to be corrected > > Yes, this would be highly desired, but, as Aaron has said, there is no > simple general way to check the rationality of an expression. > > Could you please describe what you are trying to achieve? If you can > narrow down your problem sufficiently well, you may be able to devise > an ad-hoc way to check the rationality of an expression in your > domain. > > Sergiu
Problems only arise if you have transcendental numbers, or if you have symbolic expressions with some assumptions on them. If you are dealing with a non-symbolic algebraic number, it is always possible to tell if it's rational or not. One way is to use minpoly() and see if the minimal polynomial is linear or not. We don't currently do this because minpoly() is too slow for non-trivial algebraic numbers (if I remember correctly). Aaron Meurer -- You received this message because you are subscribed to the Google Groups "sympy" group. 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/sympy?hl=en.
