I mean, I know about this, I guess it's just jarring to see it in action (especially when the truth of x > x-1 depends on how many variables your polynomial ring has). I feel like it goes against duck-typing. If I write code that I want to work as long as there's a well-defined notion of positivity, checking if something is > 0 feels like the right duck-typing thing to do. I guess I'll try some other way.
On Saturday, June 27, 2020 at 12:40:54 AM UTC-10, Dima Pasechnik wrote: > > On Sat, Jun 27, 2020 at 10:38 AM Rob H. <robert...@gmail.com <javascript:>> > wrote: > > > > > > > > Hi all, > > > > So I was surprised to find out that asking if a polynomial is > 0 > doesn't raise an error. > > many Sage objects compare in a totally non-mathematical way, just to > be able to sort them. > Polynomials are no exception. > > One day we might have a way to test global nonnegativity/positivity of > polynomials with coefficients in > an ordered field, but we're far from this now. > > > Now, maybe there's a good reason why it returns True and I'm too tired > to think about why. At the very least, here is some disturbing behaviour. > > > > sage: R.<x> = PolynomialRing(QQ) > > sage: x > x-1 > > True > > sage: R.<x,y> = PolynomialRing(QQ) > > sage: x > x-1 > > False > > sage: x+1 > x > > True > > > > I'm hoping someone can tell me why this behaviour is correct, or confirm > that it's wrong. > > > > -- > > You received this message because you are subscribed to the Google > Groups "sage-support" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to sage-s...@googlegroups.com <javascript:>. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-support/c7609632-1d79-4298-8daf-cc9682ff6664o%40googlegroups.com. > > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/995a7301-5b2c-43ad-82fc-3b899a1a4ed8o%40googlegroups.com.