On Nov 2, 2008, at 12:02 PM, William Stein wrote: > > On Sun, Nov 2, 2008 at 11:58 AM, Kevin Buzzard > <[EMAIL PROTECTED]> wrote: >>> That would be inconsistent with the choice made by every other >>> math software system ever written and with common mathematical >>> usage as well. It would thus cause excessive confusion, and likely >>> not be very useful. >> >> I can believe this. And yet if there's an "IsPositive" command in >> sage, what >> does IsPositive(Sqrt(5)) give? > > There is no IsPositive (or is_positive) command in Sage. If there > were it would definitely give True because > > sage: float(sqrt(5)) > 2.2360679774997898 > >> >> I think that my main problem is that I am not used to maths >> packages that >> think sqrt(5) is anything other than a positive real. > > Sage does think it is a positive real. You're used to math > packages like Pari > and Magma that both think sqrt(5) is a "positive rational", by > which I somewhat > sarcastically mean a finite-precision floating point number. Also, I > bet you're also used > to Magma, which thinks of sqrt(5) alternatively as a number field > element which > doesn't have a choice of sign. In Sage, sqrt(5) is the exact positive > sqrt of 5. > > sage: a = sqrt(5) > sage: a > sqrt(5) > sage: a^2 > 5 > sage: expand((a+1)^2) > 2*sqrt(5) + 6 > sage: float(a) > 2.2360679774997898 > sage: numerical_approx(a, digits=40) > 2.236067977499789696409173668731276235441 > sage: QQ[a] > Number Field in sqrt5 with defining polynomial x^2 - 5 > > Actually, at the point when I do QQ[a] and get a number field, a > looses > the choice of sign. That's changing in the next version of Sage > though, > due to work of Robert Bradshaw.
Assuming somebody reviews that patch of course (hint, hint :). There's also a faster SR minpoly patch up as well, which should help here a lot. - 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
