@aaron ... i have now sympy version 7.1 . which gives none for sqrt(3).is_rational but when i checked the same on sympy live it gave me true .
and presently sympy live is not working, if i am not wrong. On Sun, Mar 4, 2012 at 9:39 AM, prateek papriwal <[email protected]>wrote: > we can do the following thing (talking about square roots) > > For integer inputs, only the square roots of the square numbers are > rationals. So our problem boils down to find if our number is a square > number . in this way sqrt(3) can be checked . > If we have rational numbers as inputs (that is, a number given as the > ratio between two integer numbers), check that both divisor and dividend > are perfect squares. in this way 4.41 can be checked . > > Finally we know that any finite floating point number is a rational number > .. > On Sun, Mar 4, 2012 at 5:05 AM, Aaron Meurer <[email protected]> wrote: > >> 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. >> >> > -- 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.
